+1-888-365-2779
Try Now
More in this section

Forums / Security / Custom permissions

Custom permissions

6 posts, 1 answered
  1. Saumitra
    Saumitra avatar
    127 posts
    Registered:
    10 Mar 2009
    04 Sep 2010
    Link to this post
    Hi,

    I'm trying to implement custom security model for intra-site modules using Sitefinity 3.7 Standard Edition, instead of using the in-built security mechanism. This is because I've a requirement where the permissions need to be scaled down to the views in an intra-site module (granular permissions) instead of being restricted only at the Module level.
    I've been fairly successful in implementing the security part except for a small issue - I cannot control that If a role does not have access permissions to any of the views in a module, the module should not be visible in the Modules menu on the top of the screen.

    Can you please help me out ?

    Thanks,
    Saumitra
  2. Saumitra
    Saumitra avatar
    127 posts
    Registered:
    10 Mar 2009
    06 Sep 2010
    Link to this post
    Hi,

    Any updates on this would be helpful.

    Thanks,
    Saumitra
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    06 Sep 2010
    Link to this post
    Hello Saumitra,

    Inside Sitefinity\Admin\Admin.master.cs MainMenu_DataBound you can get all roles for the current user and check whether you have set a view permissions for any of the roles. If the result is true you will show the MainMenu RadTab.

    protected bool CheckRole()
    {
     
        foreach (string role in UserManager.GetCurrentUserRoles())
        {
         // check permissions per view.
        }
        return true;
    }


    Kind regards,
    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
    Answered
  4. Saumitra
    Saumitra avatar
    127 posts
    Registered:
    10 Mar 2009
    06 Sep 2010
    Link to this post
    Hi Ivan,

    Thanks for the response. As far I understand the CMS Admin pages structure, the MainMenu does not contain the tabs for the individual intra-site modules (i guess its the "repeaterModules" repeater control in Sitefinity\Admin\Default.aspx). I wish to make visible / invisible each of the individual custom modules based on the permissions set for the views in those modules.

    Thanks,
    Saumitra
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    06 Sep 2010
    Link to this post
    Hi Saumitra,

    Inside Inside Sitefinity\Admin\Admin.master.cs there is a RadTabStrip control that shows all tabs, otherwise you would not see your module as a RadTab

    Kind regards,
    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
  6. Saumitra
    Saumitra avatar
    127 posts
    Registered:
    10 Mar 2009
    06 Sep 2010
    Link to this post
    Hi Ivan,

    Yes, I got it. Inside admin.master.cs, the MainMenu is a RadTabStrip collection and each of the elements in that collection has a RadTab collection. What I needed to do was access and manipulate the RadTab collection for the "Modules" RadTabStrip. I did that and it worked.

    Thanks for all the help.

    Saumitra
Register for webinar
6 posts, 1 answered