当前位置: 首页>>代码示例>>C#>>正文


C# CurrentUserInfo.IsAuthorizedPerTreeNode方法代码示例

本文整理汇总了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;
        }
//.........这里部分代码省略.........
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:101,代码来源:EditToolbar.ascx.cs


注:本文中的CurrentUserInfo.IsAuthorizedPerTreeNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。