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

Forums / Developing with Sitefinity / Simple security for custom Module based on role

Simple security for custom Module based on role

12 posts, 0 answered
  1. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    15 Apr 2008
    Link to this post

    Hi,

    Could you help to implement hide or view the title module name of one custom module based on role? Can I use as simple security for Custom modules.

     

  2. Dave
    Dave avatar
    76 posts
    Registered:
    10 Mar 2008
    16 Apr 2008
    Link to this post
    I believe the best way to do this is to implement the basic global permissions for your module.  Check out these two links:

    Add Permissions to a Pluggable Module: Global Permission
    Add Permissions to a Pluggable Module: Control Panel

    They will help you get your module and its admin section setup for managing its permissions.

    Finally your module's WebModule class should implement Telerik.Security.Permissions.ISecuredModule.  If your module's manager class inherits Telerik.Cms.Engine.ContentManager, I believe you can use the ContentManager's static SecurityRoots object in your ISecuredModule implementation.  Not sure if that's the best way to go about it, but it worked for me.  Hope that helps.
  3. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    16 Apr 2008
    Link to this post
    Hi Dave,

    I know this elements but they are complex. I would make only one simple security hiding the title name of Custom Module. Actually Newsletter is openned with no security and my others modules, same. Telerik team will prepare new samples, but actually I need quickly one solution. Regards
     
  4. Dave
    Dave avatar
    76 posts
    Registered:
    10 Mar 2008
    16 Apr 2008
    Link to this post
    Hi Pierre,

    In that case, I believe just implementing the ISecuredModule on your WebModule class will hide the title for non-Administrators, but you won't be able to alter roles through youruser interface without adding the Permissions Set form to your module's control panel.  Unfortunately I don't know of any truly quick solutions for this particular task.
  5. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    16 Apr 2008
    Link to this post
    Hi Dave,

    Ok, but now you are in the initial question. how to make this?
  6. Dave
    Dave avatar
    76 posts
    Registered:
    10 Mar 2008
    16 Apr 2008
    Link to this post
    Here's an example of the ISecuredModule implementation.  Unfortunately I don't have time to get into the specifics of creating the Module itself, or the Manager or Provider classes, but it sounds like you already have those.

        /// <summary> 
        /// This is your custom module. 
        /// </summary> 
        public class PierresModule : WebModule, ISecuredModule 
        { 
     
            public override IList<Telerik.Web.IToolboxItem> Controls 
            { 
                get { return new List<Telerik.Web.IToolboxItem>() { 
                     
                }; } 
            } 
     
            public override string Description 
            { 
                get { return "Pierre's Module"; } 
            } 
     
            public override string Name 
            { 
                get { return "Pierre's Module"; } 
            } 
     
            public override string Title 
            { 
                get { return "Pierre's Module"; } 
            } 
            #region ISecuredModule Members 
     
            ISecured ISecuredModule.SecurityRoot 
            { 
                get { return PierresManager.SecurityRoots[Configuration.ConfigHelper.Handler.DefaultProvider]; } 
            } 
     
            IDictionary<string, ISecured> ISecuredModule.SecurityRoots 
            { 
                get { return PierresManager.SecurityRoots; } 
            } 
            #endregion 
        } 
     
        /// <summary> 
        /// This is your Manager class, which uses your provider to perform tasks for your module. 
        /// </summary> 
        public class PierresManager : ContentManager 
        { 
     
        } 
     

  7. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    17 Apr 2008
    Link to this post
    Hello Dave,

    Thank you for participating in our forum community. Our team highly appreciates it. As a sign of gratitude to your contribution, we have updated your Telerik points.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    17 Apr 2008
    Link to this post

    Hi Dave,

    Thanks for try but this is one sample found in Real Estate implementation for securing custom Module based in panels security found by Telerik. You can not accomplish the task using this.  

     

  9. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    23 Apr 2008
    Link to this post
    Hi Pierre,

    We believe that Dave provided you a very exhaustive guidance and instructions on implementing your request.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. JAllen
    JAllen avatar
    34 posts
    Registered:
    23 Dec 2010
    20 Jan 2011
    Link to this post
    Hi all,
    I just found this thread and the linked documentation appears to be exactly what I need, however the links seem broken.  Has this moved location or is there an issue with the server?

    We're trying to make our custom modules act like the built in modules in terms of role-based permissions.

    Thanks
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    20 Jan 2011
    Link to this post
    Hi,

    Please check the Security TOC articles.

    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
  12. JAllen
    JAllen avatar
    34 posts
    Registered:
    23 Dec 2010
    26 Jan 2011
    Link to this post
    EDIT: Nevermind - I found it
Register for webinar
12 posts, 0 answered