Пример #1
0
        public HttpResponseMessage CopyPermissionsToChildren()
        {
            if (TabPermissionController.CanManagePage() && UserController.GetCurrentUserInfo().IsInRole("Administrators") &&
                ActiveTabHasChildren() && !PortalSettings.ActiveTab.IsSuperTab)
            {
                TabController.CopyPermissionsToChildren(PortalSettings.ActiveTab, PortalSettings.ActiveTab.TabPermissions);
                return(Request.CreateResponse(HttpStatusCode.OK));
            }

            return(Request.CreateResponse(HttpStatusCode.InternalServerError));
        }
Пример #2
0
        public virtual void ControlPanelTool_OnClick(object sender, EventArgs e)
        {
            switch (this.ToolInfo.ToolName)
            {
            case "DeletePage":
                if (this.HasToolPermissions("DeletePage"))
                {
                    string url = TestableGlobals.Instance.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=delete");
                    this.Page.Response.Redirect(url, true);
                }

                break;

            case "CopyPermissionsToChildren":
                if (this.HasToolPermissions("CopyPermissionsToChildren"))
                {
                    TabController.CopyPermissionsToChildren(PortalSettings.ActiveTab, PortalSettings.ActiveTab.TabPermissions);
                    this.Page.Response.Redirect(this.Page.Request.RawUrl);
                }

                break;

            case "CopyDesignToChildren":
                if (this.HasToolPermissions("CopyDesignToChildren"))
                {
                    TabController.CopyDesignToChildren(PortalSettings.ActiveTab, PortalSettings.ActiveTab.SkinSrc, PortalSettings.ActiveTab.ContainerSrc);
                    this.Page.Response.Redirect(this.Page.Request.RawUrl);
                }

                break;

            case "ClearCache":
                if (this.HasToolPermissions("ClearCache"))
                {
                    this.ClearCache();
                    ClientResourceManager.ClearCache();
                    this.Page.Response.Redirect(this.Page.Request.RawUrl);
                }

                break;

            case "RecycleApp":
                if (this.HasToolPermissions("RecycleApp"))
                {
                    this.RestartApplication();
                    this.Page.Response.Redirect(this.Page.Request.RawUrl);
                }

                break;
            }
        }
        protected void cmdCopyPerm_Click(object sender, EventArgs e)
        {
            try
            {
                TabController objtabs = new TabController();
                ArrayList     arr     = GetEditableTabs();

                objtabs.CopyPermissionsToChildren(arr, dgPermissions.Permissions);
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Пример #4
0
        public void CopyPermissionsToDescendantPages(int pageId)
        {
            var portalSettings = PortalController.Instance.GetCurrentPortalSettings();
            var portalId       = portalSettings.PortalId;
            var tab            = _tabController.GetTab(pageId, portalId, false);

            if (tab == null)
            {
                throw new PageNotFoundException();
            }

            if (!TabPermissionController.CanManagePage(tab) || tab.IsSuperTab)
            {
                throw new PermissionsNotMetException(tab.TabID, Localization.GetString("CannotCopyPermissionsToDescendantPages"));
            }

            TabController.CopyPermissionsToChildren(tab, tab.TabPermissions);
        }