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

Forums / Bugs & Issues / Issue in Permissions in Generic Module

Issue in Permissions in Generic Module

8 posts, 0 answered
  1. Nimit
    Nimit avatar
    90 posts
    Registered:
    27 Mar 2009
    27 Oct 2009
    Link to this post
    Hi,
    I created a custom Generic module in Sitefinity 3.7 using the help provided in the following link http://www.sitefinity.com/help/developer-manual/products-module-overview.html.
    it works fine I can create, edit, delete, I can do everything. But now the issue comes how can I enable the Permissions in the Module.
    Please Help me ASAP.

    Regards,
    Nimit Verma.
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    28 Oct 2009
    Link to this post
    Hello Nimit,

    Thank you for using our services.

    Can you, please take a look at the following blog post: Implementing Permissions. It explains how to secure your custom generic content module.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Nimit
    Nimit avatar
    90 posts
    Registered:
    27 Mar 2009
    28 Oct 2009
    Link to this post
    Hi Radoslav,
    Thanks for reply, it is really helpful.
    When I Inheriting SecuredModule abstract class as said in the link implementing permissions.
    Like after pasting the following code:-->

     

    /// <summary>

     

     

    /// Gets the security root for the default provider

     

     

    /// </summary>

     

     

    public override ISecured SecurityRoot

     

    {

     

    get

     

    {

     

    return this.SecurityRoots[Configuration.ConfigHelper.Handler.DefaultProvider];

     

    }

    }

     

    /// <summary>

     

     

    /// Gets key/value information for provider/global permissions. Preserves information

     

     

    /// for all providers.

     

     

    /// </summary>

     

     

    public override IDictionary<string, ISecured> SecurityRoots

     

    {

     

    get

     

    {

     

    return ....Manager.SecurityRoots;

     

    }

    }


    I am getting the following errors:

    Error 1 '......manager.SecurityRoot': no suitable method found to override D:\......SchoolNotificationModule.cs 61 34 

    I don't know what to do.
    Please reply ASAP.

    Regards,
    Nimit Verma.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Oct 2009
    Link to this post
    Hi Nimit,

    Make sure that your module SchoolNotificationModule has the following structure.


    public class SchoolNotificationModule : SecuredModule
        {
            /// <summary>
            /// Gets the name of the module.
            /// </summary>
            public override string Name
            {
                get
                {
                    return ModuleName;
                }
            }
     
            /// <summary>
            /// The module title which will appear in the navigation.
            /// </summary>
            public override string Title
            {
                get
                {
                    return Messages.ModuleTitle;
                }
            }
     
            /// <summary>
            /// Short description for the module.
            /// </summary>
            public override string Description
            {
                get
                {
                    return Messages.ModuleDescription;
                }
            }
     
            /// <summary>
            /// Gets ToolboxItemCollection with all ToolboxItem objects which register the corresponding control for use in the public part of the CMS system.
            /// </summary>
            public override IList<IToolboxItem> Controls
            {
                get
                {
                    return new List<IToolboxItem>(new IToolboxItem[]
                    {
                        new ControltoolboxItem(),
                        new Control2toolboxItem(),
                    });
                }
            }
     
            #region ISecuredModule Members
     
            public override Telerik.Security.Permissions.ISecured SecurityRoot
            {
                get
                {
                    return this.SecurityRoots[Configuration.ConfigHelper.Handler.DefaultProvider];
                }
            }
     
            public override IDictionary<string, ISecured> SecurityRoots
            {
                get
                {
                    return MYMODULEMANAGER.SecurityRoots;
                }
            }
     
            #endregion
     
     
    ...
       ....
          ....

    SecurityRoot and SecurtyRoots are required ISecuredModule members.


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Nimit
    Nimit avatar
    90 posts
    Registered:
    27 Mar 2009
    28 Oct 2009
    Link to this post
    Hi Ivan,
    I will explain how I made my generic Custom Module.
    under ~/WebControls/Admin folder I have only two file CommanPanel.cs and ControlPanel.cs.
    MYMODULE.cs I copied the code
    public override Telerik.Security.Permissions.ISecured SecurityRoot
            {
                get
                {
                    return this.SecurityRoots[Configuration.ConfigHelper.Handler.DefaultProvider];
                }
            }
     
            public override IDictionary<string, ISecured> SecurityRoots
            {
                get
                {
                    return MYMODULEMANAGER.SecurityRoots;
                }
            }
    It is not working because MYMODULE.cs is inheriting Telerik.WebModule not SecuredModule.
    All my Backend .ascx file are in my project itself I mean in ~/Sitefinity/Admin/ControlTemplate/MYMODULE/.

    So What should I do, Please ASAP.

    Regards,
    Nimit Verma.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Oct 2009
    Link to this post
    Hi Nimit,

    The article you use is not supposed to work properly under Sitefinity 3.7. Please take a look at the following post and outlined documentation. Also you should inherits from SecuredModule if you want to use permissions.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Nimit
    Nimit avatar
    90 posts
    Registered:
    27 Mar 2009
    29 Oct 2009
    Link to this post
    Hi Ivan,
    I Recreated the module using the exmaple explained in http://www.sitefinity.com/blogs/ivan/posts/09-03-11/sample_generic_content_based_module_products_module.aspx

    But now I just need to know few things :-->
    1. Previously I had a button on the product insert/New page and on the onclick event i am sending an email in the code behind, how can you do that here as here the Code behind in under ~/WebControls/Adimin/Products/..
    2. Previously I had some user controls which I use in the aspx page by putting the user control and doing all the calculation and then storing the retrun value in the metatags.

    So, if you can help me with these two thing it will we great.
    Please reply ASAP.

    Regards,
    Nimit Verma.
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    30 Oct 2009
    Link to this post
    Hi Nimit,

    1. Previously I had a button on the product insert/New page and on the onclick event i am sending an email in the code behind, how can you do that here as here the Code behind in under ~/WebControls/Adimin/Products/..

    There is no code behind, since we use views and templates for the view. So you could create a code behind of the template or write your code inline. I suggest that you should go through the new backend architecture.

    2. Previously I had some user controls which I use in the aspx page by putting the user control and doing all the calculation and then storing the retrun value in the metatags.

    We have not changed any implementation related to the metatags so you should be able to use the same logic here.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
8 posts, 0 answered