Beispiel #1
0
        public DnnAppAndDataHelpers(SxcInstance sxcInstance, Log parentLog = null) : base(sxcInstance, new DnnTenant(null), parentLog)
        {
            // Init things than require module-info or similar, but not 2sxc
            var instance = sxcInstance?.EnvInstance;

            Dnn  = new DnnHelper(instance);
            Link = new DnnLinkHelper(Dnn);
        }
        public DnnAppAndDataHelpers(SxcInstance sxcInstance, Log parentLog) : base(sxcInstance, new DnnTenant(null), parentLog)
        {
            // Init things than require module-info or similar, but not 2sxc
            var instance = sxcInstance?.EnvInstance;

            Dnn  = new DnnHelper(instance);
            Link = new DnnLinkHelper(Dnn);

            // 2018-09-22 #1624 old
            //// If PortalSettings is null - for example, while search index runs - HasEditPermission would fail
            //// But in search mode, it shouldn't show drafts, so this is ok.
            //// Note that app could be null, if a user is in admin-ui of a module which hasn't actually be configured yet
            //InitAppDataFromContext(App, PortalSettings.Current, sxcInstance);
        }
Beispiel #3
0
        public DnnAppAndDataHelpers(SxcInstance sxcInstance, IInstanceInfo instance, Log parentLog) : base(sxcInstance, new DnnTenant(null), parentLog)
        {
            // Init things than require module-info or similar, but not 2sxc
            Dnn  = new DnnHelper(instance);
            Link = new DnnLinkHelper(Dnn);

            if (sxcInstance == null)
            {
                return;
            }

            // If PortalSettings is null - for example, while search index runs - HasEditPermission would fail
            // But in search mode, it shouldn't show drafts, so this is ok.
            // Note that app could be null, if a user is in admin-ui of a module which hasn't actually be configured yet
            var userMayEdit = sxcInstance.UserMayEdit;// Eav.Factory.Resolve<IPermissions>().UserMayEditContent(sexy.InstanceInfo);

            App?.InitData(PortalSettings.Current != null && userMayEdit,
                          PortalSettings.Current != null && sxcInstance.Environment.PagePublishing.IsEnabled(instance.Id),
                          Data.ConfigurationProvider);
        }