More in this section

Forums / Developing with Sitefinity / Implementing Security for module based on the generic content module

Implementing Security for module based on the generic content module

15 posts, 0 answered
  1. Shane
    Shane avatar
    28 posts
    Registered:
    27 Jul 2008
    27 Aug 2008
    Link to this post
    Hi Guys,

    I am currently implementing a new module based on the generic content module (like the products example).

    I have one last step to required before I can continue, and that is role based security. You mention on the page

    http://www.sitefinity.com/help/developer-manual/generic-content-api-overview.html

    that you don't need to write code to implement security - can you please let me how? The example I am currently looking at has the viewpermissions link on the command panel commented out.

    I have added this link and wired up the command link and now have the permissions page being displayed on the control panel portion of the page. But it doesn't work. I do get a page that seems to behave as other modules but roles I go to assign permissions to all the deny checkboxes are all disabled and are checked? I can tick allow and save; this seems to work. But users assigned the appropriate role and permissions can see the module link in the navigation but a security exception is thrown once the link is clicked.

    Can you please give me a step by step guide on how to implement the module security?

    Thanks,

    Shane.

  2. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    01 Sep 2008
    Link to this post
    Hi Shane,

    We are currently working on the sample and article on how to enable permissions and we hope we will manage to publish it in the next week's update of Developer's manual. The sample will be based on the sample products module.

    I am sorry that I was not able to help you more at this time and I hope that it will not cause you great problems to wait till next week. Let us know if there is anything else we can do for you.

    Regards,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Shane
    Shane avatar
    28 posts
    Registered:
    27 Jul 2008
    16 Sep 2008
    Link to this post
    Hi Ivan,

    I am just wondering when the security module implementation will be ready for public eyes.

    This is the last piece of the puzzle before this application can be fully tested and deployed.

    Thanks,

    Shane
  4. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    16 Sep 2008
    Link to this post
    Hi Shane,

    I'd like to apologize that this is taking so long. We are working very hard on several different areas at the moment and I will give my best to get the rest of the GC based module topics in the manual as soon as possible (including security of course).

    Thank you for your patience and understanding.

    Sincerely yours,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Shane
    Shane avatar
    28 posts
    Registered:
    27 Jul 2008
    23 Sep 2008
    Link to this post
    Hi Ivan,

    Sorry to be a pain but when do you think the security aspect of creating a custom generic module will be published.

    I am now having to explain to my boss and the business that the reason I haven't released the application is due to this one issue. I need to have this security implemented asap.

    Thanks,

    Shane.
  6. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    26 Sep 2008
    Link to this post
    Hello Shane,

    we'll try to have it published next week. If we encounter problems with Dev Manual build I'll make sure to publish it on the blog. Once again, I am sorry, but we were swamped with the preparations for the new release which will be out by the end of this month or in first days of October.

    Thank you for your understanding and I am truly sorry that we have caused you problems at your work.

    Best wishes,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Grant
    Grant avatar
    13 posts
    Registered:
    24 Jan 2008
    02 Oct 2008
    Link to this post
    Is there any chance that will be coming down the pipe this week?  I am also waiting on the custom module permissions "how to".  Any update would be greatly appreciated.

    Thanks.
    Drew
  8. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    08 Oct 2008
    Link to this post
    Hello Grant,

    We have plans to start working on "Products module – simple implementation with enabled permissions" topic after the official release of version 3.5. We will contact you right now when the example is completely implemented.

    In the meantime I'll try to shed some light on implementing module permissions. When you create a module, you create a Data provider for the module, which takes care of everything that needs to be persisted somewhere. If you need to secure your module, you use the Sitefinity API and implement the classes needed for this, but do NOT implement a security provider. The Sitefinity security API uses its own security provider in the Telerik.Security assembly, so in fact when you use the API, you are using the default security provider, not creating your own.

    To implement security for a Generic Content based module, follow these steps:
    • Your module class should inherit from Telerik.Security.Permissions.SecuredModule base class. This class implements the ISecured interface.
    • In your manager class, implement a SecurityRoots dictionary. This SecurityRoots should persist an ID (GUID) for every secured object. When building modules this means one for each data provider.
    • When setting permissions through the UI, you should use the PermissionSet control
    • When checking for user permissions do this through the manager by calling GetPermission() method.
    Thanks a lot for your patience.


    Kind regards,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Shane
    Shane avatar
    28 posts
    Registered:
    27 Jul 2008
    14 Oct 2008
    Link to this post
    Hi,

    In Regard to the steps you specified when replying to Grant - in your documentation about using the generic content based module you state no code is required to implement security - is this not right?

    I am quite a few weeks behind in releasing the new module just because of the security problem.

    We have purchased your product - and security is a pretty core piece of functionality to simply not document etc....

    We need immediate response please, can you send a draft or something just to keep me going?

    Thanks,

  10. Shane
    Shane avatar
    28 posts
    Registered:
    27 Jul 2008
    19 Oct 2008
    Link to this post
    Hi Guys,

    I still haven't heard anything about this issue.

    Please contact me asap.
  11. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    20 Oct 2008
    Link to this post
    Hello Shane,

    once again, our sincere apologies. We've been swamped with the 3.5 release and one other major project. Nevertheless, we have set some time aside now and will have this sample by the beginning of the next week.

    Thank you for your understanding.

    Greetings,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  12. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    06 Nov 2008
    Link to this post
    Hello Shane,

    I just follow up to tell you that we have posted some updates (which will enter in the Dev.Manual soon) to this module in our Blogs. The examples show you how to use Tags and Permissions in this module.

    All the best,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  13. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    06 Nov 2008
    Link to this post
    Hi Shane,

    I have attached a simple implementation of the "Products" module with enabled permissions. You could also find useful information on this matter in the following blog post.

    Do let us know if you need any further assistance.

    Best wishes,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  14. Imran
    Imran avatar
    75 posts
    Registered:
    17 Jan 2007
  15. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    08 Jan 2009
    Link to this post
    Hi Imran,

    Please try the following links:
    Products module with permissions
    In the mean time series (part 3): "Products" module - simple implementation with enabled permissions

    Do let us know if the problem still persists.

    Regards,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
15 posts, 0 answered