More in this section
Forums / Security / Permission for link

Permission for link

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. sunil tambe
    sunil tambe avatar
    2 posts
    Registered:
    09 Apr 2010
    09 Apr 2010
    Link to this post
    Hello

        I have add new link under the Dachboard section in the Admin/Default.aspx page just below the "Add User" link. As same "Create a Page" and "Add User" i want to set global permissions based on user provide my newly link.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    12 Apr 2010
    Link to this post
    Hello sunil tambe,

    You have to create a custom class that inherits from GlobalRights . Then implement the new permission you want to have

    sample

    public class GlobalRightsCustom : GlobalRights
    {
        /// <summary>
        /// Constructor of the GlobalRightsCustom class
        /// </summary>
        protected GlobalRightsCustom ()
        {
        }
     
        
        /// <summary>
        /// Returns an integer value for the CustomRight property
        /// </summary>
        [LocalRight("CustomRight ")]
        public static int CustomRight
        {
            get
            {
                return 32;
            }
        }
     
     
        
        public new static GlobalRightsCustom Instance
        {
            get
            {
                return instance;
            }
        }
     
        private static GlobalRightsCustom instance = new GlobalRightsCustom();
    }

    Then you need to replace all instance of the default GlobalRights with your custom class

    • GlobalPermissions.cs(42):            this.rights = GlobalRights.Instance;
    • CmsHttpModule.cs(313):                Telerik.Cms.Security.GlobalRights.CmsAccess);
    • MainMenuSourceView.cs(29):         Telerik.Cms.Security.GlobalPermission perm = new Telerik.Cms.Security.GlobalPermission(GlobalRights.ManageUsers);
    • MainMenuSourceView.cs(31):            bool canManagePermissions = perm.CheckDemand(GlobalRights.ManagePermissions);
    • MainMenuSourceView.cs(32):           bool canEditTemplates = perm.CheckDemand(GlobalRights.EditTemplates);
    • MainMenuSourceView.cs(67):           if (perm.CheckDemand(GlobalRights.ManageFiles))
    • PageHistory.cs(338):               GlobalPermission perm = new GlobalPermission(GlobalRights.EditTemplates);
    • PageHistory.cs(358):                GlobalPermission perm = new GlobalPermission(GlobalRights.EditTemplates);
    • PageProperties.cs(331):               perm = new GlobalPermission(GlobalRights.EditTemplates);
    • PageTemplatesDataSourceView.cs(100):                    GlobalPermission perm = new GlobalPermission(GlobalRights.EditTemplates);
    • GlobalDashboardItems.cs(171):                GlobalPermission perm = new GlobalPermission(GlobalRights.ManageUsers);
    • TemplateEditor.cs(53):               new Telerik.Cms.Security.GlobalPermission(GlobalRights.EditTemplates);
    • UrlEditorWrapper.cs(122):            GlobalPermission perm = new GlobalPermission(GlobalRights.ManageFiles);
    • Permissions.aspx.cs(30):            return GlobalRights.ManagePermissions;
    • \Permissions.aspx.cs(63):        GlobalPermission perm = new GlobalPermission(GlobalRights.ManagePermissions);
    • Users.aspx.cs(33):            return GlobalRights.ManageUsers;
    • Sitefinity\Admin\ControlTemplates\Libraries\Dialogs\ItemSelector.ascx.cs(12):        GlobalPermission perm = new GlobalPermission(GlobalRights.ManageFiles);

    • Sitefinity\Admin\ControlTemplates\Pages\Dialogs\PagesSelector.ascx.cs(12):        GlobalPermission perm = new GlobalPermission(GlobalRights.ManageFiles);
    •  Sitefinity\Admin\Default.aspx.cs(86):       Telerik.Cms.Security.GlobalPermission perm = new Telerik.Cms.Security.GlobalPermission(GlobalRights.ManageUsers);
    • Sitefinity\Admin\Default.aspx.cs(87):       bool canEditTemplates = perm.CheckDemand(GlobalRights.EditTemplates);
    • Sitefinity\Admin\Default.aspx.cs(112):       perm = new Telerik.Cms.Security.GlobalPermission(Telerik.Cms.Security.GlobalRights.ManageUsers | GlobalRights.ManagePermissions);
     
    • Sitefinity\Admin\Default.aspx.cs(119):       perm = new Telerik.Cms.Security.GlobalPermission(Telerik.Cms.Security.GlobalRights.ManageFiles);
     
    • Sitefinity\Admin\Default.aspx.cs(213):               new Telerik.Cms.Security.GlobalPermission(Telerik.Cms.Security.GlobalRights.ManageUsers);
     
    • Sitefinity\Admin\Files.aspx.cs(30):            return GlobalRights.ManageFiles;
    •  
    • Sitefinity\Admin\Templates.aspx.cs(29):           return Telerik.Cms.Security.GlobalRights.EditTemplates;
     
     


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
2 posts, 0 answered