本文整理汇总了C#中CurrentUserInfo.IsAuthorizedPerTreeNode方法的典型用法代码示例。如果您正苦于以下问题:C# CurrentUserInfo.IsAuthorizedPerTreeNode方法的具体用法?C# CurrentUserInfo.IsAuthorizedPerTreeNode怎么用?C# CurrentUserInfo.IsAuthorizedPerTreeNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CurrentUserInfo
的用法示例。
在下文中一共展示了CurrentUserInfo.IsAuthorizedPerTreeNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
/// <summary>
/// Handles the Load event of the Page control.
/// </summary>
protected void Page_Load(object sender, EventArgs e)
{
// Do not process control by default
StopProcessing = true;
// Keep frequent objects
cui = CMSContext.CurrentUser;
PageInfo pi = CMSContext.CurrentPageInfo;
if (pi == null)
{
IsPageNotFound = true;
pi = OnSiteEditHelper.PageInfoForPageNotFound;
}
ucUIToolbar.StopProcessing = true;
largeCMSDeskButton = !cui.UserSiteManagerAdmin;
// Check whether user is authorized to edit page
if ((pi != null) && cui.IsAuthenticated() && cui.IsEditor && ((IsPageNotFound && pi.NodeID == 0) || cui.IsAuthorizedPerTreeNode(pi.NodeID, NodePermissionsEnum.Read) == AuthorizationResultEnum.Allowed))
{
// Enable processing
StopProcessing = false;
// Check whether the preferred culture is RTL
isRTL = CultureHelper.IsUICultureRTL();
// Add link to CSS file
CSSHelper.RegisterCSSLink(Page, "Design", "OnSiteEdit.css");
// Filter UI element buttons
ucUIToolbar.OnButtonFiltered += ucUIToolbar_OnButtonFiltered;
ucUIToolbar.OnButtonCreated += ucUIToolbar_OnButtonCreated;
ucUIToolbar.OnButtonCreating += ucUIToolbar_OnButtonCreating;
ucUIToolbar.OnGroupsCreated += ucUIToolbar_OnGroupsCreated;
ucUIToolbar.IsRTL = isRTL;
// Register edit script file
RegisterEditScripts(pi);
if (ViewMode == ViewModeEnum.EditLive)
{
popupHandler.Visible = true;
IsLiveSite = false;
MessagesPlaceHolder.IsLiveSite = false;
MessagesPlaceHolder.Opacity = 100;
// Display warning in the Safe mode
if (PortalHelper.SafeMode)
{
string safeModeText = GetString("onsiteedit.safemode") + "<br/><a href=\"" + URLHelper.RawUrl.Replace("safemode=1", "safemode=0") + "\">" + GetString("general.close") + "</a> " + GetString("contentedit.safemode2");
string safeModeDescription = GetString("onsiteedit.safemode") + "<br/>" + GetString("general.seeeventlog");
// Display the warning message
ShowWarning(safeModeText, safeModeDescription, "");
}
ucUIToolbar.StopProcessing = false;
// Ensure document redirection
if (!String.IsNullOrEmpty(pi.DocumentMenuRedirectUrl))
{
string redirectUrl = CMSContext.ResolveMacros(pi.DocumentMenuRedirectUrl);
redirectUrl = URLHelper.ResolveUrl(redirectUrl);
ShowInformation(GetString("onsiteedit.redirectinfo") + " <a href=\"" + redirectUrl + "\">" + redirectUrl + "</a>");
}
}
// Mode menu on live site
else if (ViewMode == ViewModeEnum.LiveSite)
{
// Hide the edit panel, show only slider button
pnlToolbarSpace.Visible = false;
pnlToolbar.Visible = false;
pnlSlider.Visible = true;
imgSliderButton.ImageUrl = GetImageUrl("CMSModules/CMS_PortalEngine/OnSiteEdit/edit.png");
imgSliderButton.ToolTip = GetString("onsiteedit.editmode");
imgSliderButton.AlternateText = GetString("onsitedit.editmode");
pnlButton.Attributes.Add("onclick", "OnSiteEdit_ChangeEditMode();");
imgMaximize.Style.Add("display", "none");
imgMaximize.AlternateText = GetString("general.maximize");
imgMaximize.ImageUrl = GetImageUrl("CMSModules/CMS_PortalEngine/OnSiteEdit/ArrowDown.png");
imgMinimize.ImageUrl = GetImageUrl("CMSModules/CMS_PortalEngine/OnSiteEdit/ArrowUp.png");
imgMinimize.AlternateText = GetString("general.minimize");
pnlMinimize.Attributes.Add("onclick", "OESlideSideToolbar();");
// Hide the OnSite edit button when displayed in CMSDesk
pnlSlider.Style.Add("display", "none");
}
}
// Hide control actions for unauthorized users
else
{
plcEdit.Visible = false;
}
//.........这里部分代码省略.........