Using Roles to Restrict Access?

7 posts, 0 answers
  1. Mitchel
    Mitchel avatar
    8 posts
    Member since:
    Apr 2008

    Posted 30 Apr 2008 Link to this post

    I am looking at creating a menu that will display only specific elements to users in a specific role.  Is there an example of this?
  2. Gary Mazur
    Gary Mazur avatar
    12 posts
    Member since:
    Jan 2006

    Posted 02 May 2008 Link to this post

    I am looking for this too!  ASPMenu/Sitemap is somewhat limited.
  3. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 05 May 2008 Link to this post

    Hello,

    Please, find attached a small demo project showing how to access roles and custom attributes of a SiteMapDataSource in the ItemDataBound event of RadMenu. If you need to display only certain nodes based on the current item's role, you can set the e.Item.Visible property.

    I hope you find this helpful.

    Regards,
    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. Gary Mazur
    Gary Mazur avatar
    12 posts
    Member since:
    Jan 2006

    Posted 06 May 2008 Link to this post

    Thanks for the demo.  Is there any such demo of RadMenu setting Roles on buttons using the normal XML/DB structure RAD Menu has instead of the .Net sitemap?

    Also, where can I get a copy of the files in the bin folder of this demo?  Telerik.Web.UI

    Thanks,

    Gary

  5. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 08 May 2008 Link to this post

    Hi Gary,

    Attached is a project showing one possible solution with XmlDataSource and roles. You can get the latest version of Telerik.Web.UI from your client.net account.

    Feel free to contact us if you have any other questions.


    Kind regards,
    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Joseph
    Joseph avatar
    3 posts
    Member since:
    Aug 2017

    Posted 16 Oct 2019 Link to this post

    So I see that Peter has provided a solution if you're using a Site Map DataSource, but what if you are using a Database DataSource?

    Thanks!

  7. Vessy
    Admin
    Vessy avatar
    2130 posts

    Posted 21 Oct 2019 Link to this post

    Hi Joseph,

    In a DataSource scenario, you can keep the Roles into a separate data column in the data table and access them directly from there. You can see a similar data-accessing approach in the following live demo:

    https://demos.telerik.com/aspnet-ajax/treemap/overview/defaultcs.aspx

    Regards,
    Vessy
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top