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


C# TreeProvider.CheckDocumentUIPermissions方法代码示例

本文整理汇总了C#中TreeProvider.CheckDocumentUIPermissions方法的典型用法代码示例。如果您正苦于以下问题:C# TreeProvider.CheckDocumentUIPermissions方法的具体用法?C# TreeProvider.CheckDocumentUIPermissions怎么用?C# TreeProvider.CheckDocumentUIPermissions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TreeProvider的用法示例。


在下文中一共展示了TreeProvider.CheckDocumentUIPermissions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    /// <summary>
    /// Page load.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptHelper.RegisterScriptFile(this, @"~/CMSModules/Content/CMSDesk/View/Listing.js");

        currentSiteName = CMSContext.CurrentSiteName;
        currentUserInfo = CMSContext.CurrentUser;

        // Current Node ID
        nodeId = QueryHelper.GetInteger("nodeid", 0);

        // Setup page title text and image
        CurrentMaster.Title.TitleText = GetString("Content.ListingTitle");
        CurrentMaster.Title.TitleImage = GetImageUrl("CMSModules/CMS_Content/Menu/Listing.png");

        CurrentMaster.Title.HelpName = "helpTopic";
        CurrentMaster.Title.HelpTopicName = "list_tab";

        string[,] actions = new string[1, 6];
        actions[0, 0] = HeaderActions.TYPE_HYPERLINK;
        actions[0, 1] = GetString("Listing.ParentDirectory");
        actions[0, 5] = GetImageUrl("CMSModules/CMS_Content/Listing/parent.png");
        CurrentMaster.HeaderActions.Actions = actions;

        if (nodeId > 0)
        {
            tree = new TreeProvider(currentUserInfo);
            checkPermissions = tree.CheckDocumentUIPermissions(currentSiteName);
            node = tree.SelectSingleNode(nodeId, TreeProvider.ALL_CULTURES);
            // Set edited document
            EditedDocument = node;

            if (node != null)
            {
                if (currentUserInfo.IsAuthorizedPerDocument(node, NodePermissionsEnum.ExploreTree) != AuthorizationResultEnum.Allowed)
                {
                    RedirectToCMSDeskAccessDenied("CMS.Content", "exploretree");
                }

                aliasPath = node.NodeAliasPath;

                // Setup the link to the parent document
                if ((node.NodeClassName.ToLower() != "cms.root") && (currentUserInfo.UserStartingAliasPath.ToLower() != node.NodeAliasPath.ToLower()))
                {
                    CurrentMaster.HeaderActions.Actions[0, 3] = "javascript:SelectItem(" + node.NodeParentID + ");";
                }
                else
                {
                    CurrentMaster.HeaderActions.Visible = false;
                    CurrentMaster.PanelBody.FindControl("pnlActions").Visible = false;
                }
            }

            ScriptHelper.RegisterProgress(this);
            ScriptHelper.RegisterDialogScript(this);
            ScriptHelper.RegisterJQuery(this);

            InitDropdowLists();

            cultureElem.DropDownCultures.Width = 222;

            // Prepare JavaScript for actions
            StringBuilder actionScript = new StringBuilder();
            actionScript.Append(
        @"function PerformAction(selectionFunction, selectionField, dropId){
        var label = document.getElementById('" + lblInfo.ClientID + @"');
        var whatDrp = document.getElementById('" + drpWhat.ClientID + @"');
        var action = document.getElementById(dropId).value;
        var selectionFieldElem = document.getElementById(selectionField);
        var allSelected = " + (int)What.SelectedDocuments + @";
        if (action == '" + (int)Action.SelectAction + @"'){
        label.innerHTML = '" + GetString("massaction.selectsomeaction") + @"';
        return false;
        }
        if(whatDrp.value == '" + (int)What.AllDocuments + @"'){
        allSelected = " + (int)What.AllDocuments + @";
        }
        var items = selectionFieldElem.value;
        if(!eval(selectionFunction) || whatDrp.value == '" + (int)What.AllDocuments + @"'){
        var argument = '|' + allSelected + '|' + items;
        switch(action){
            case '" + (int)Action.Move + @"':
                argument = '" + Action.Move + "' + argument;" + ClientScript.GetCallbackEventReference(this, "argument", "OpenModal", string.Empty) + @";
                break;

            case '" + (int)Action.Copy + @"':
                argument = '" + Action.Copy + "' + argument;" + ClientScript.GetCallbackEventReference(this, "argument", "OpenModal", string.Empty) + @";
                break;

            case '" + (int)Action.Link + @"':
                argument = '" + Action.Link + "' + argument;" + ClientScript.GetCallbackEventReference(this, "argument", "OpenModal", string.Empty) + @";
                break;

            case '" + (int)Action.Delete + @"':
                argument = '" + Action.Delete + "' + argument;" + ClientScript.GetCallbackEventReference(this, "argument", "Redirect", string.Empty) + @";
                break;

            case '" + (int)Action.Publish + @"':
//.........这里部分代码省略.........
开发者ID:KuduApps,项目名称:Kentico,代码行数:101,代码来源:Listing.aspx.cs


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