private void Page_Load(object sender, EventArgs e) { Assert.ArgumentNotNull(sender, "sender"); Assert.ArgumentNotNull(e, "e"); if (!ShellPage.IsLoggedIn()) { return; } var s = string.Empty; switch (WebUtil.GetQueryString("cmd").ToLowerInvariant()) { case "gettreeviewchildren": s = GetTreeViewChildren(); break; case "expandtreeviewtonode": s = ExpandTreeViewToNode(); break; case "getcontextualtabs": s = GetContextualTabs(); break; case "convert": s = DesignTimeConvert(); break; case "treeviewcontent": s = GetTreeViewContent(); break; } Response.Write(s); }
protected override void OnLoad(EventArgs e) { Assert.ArgumentNotNull((object)e, nameof(e)); ShellPage.IsLoggedIn(true); base.OnLoad(e); ComponentArtGridHandler <PublishActivityItem> .Manage(this.PublishActivityGrid, (IGridSource <PublishActivityItem>) new GridSource <PublishActivityItem>(repository.GetAllPublishingItems()), this.RebindRequired); this.PublishActivityGrid.LocalizeGrid(); this.WriteLanguageAndBrowserCssClass(); }
/// <summary> /// Checks the security. /// </summary> /// <exception cref="AccessDeniedException"> /// Application access denied. /// </exception> protected virtual void CheckSecurity() { ShellPage.IsLoggedIn(); var user = Context.User; if (user.IsAdministrator) { return; } var isDeveloping = user.IsInRole("sitecore\\Sitecore Client Developing"); var isMaintaining = user.IsInRole("sitecore\\Sitecore Client Maintaining"); var isAccessDenied = !isDeveloping && !isMaintaining; if (isAccessDenied) { throw new AccessDeniedException("Application access denied."); } }