This is a migrated thread and some comments may be shown as answers.

Using Roles to Restrict Access?

6 Answers 174 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Mitchel
Top achievements
Rank 1
Mitchel asked on 30 Apr 2008, 09:02 PM
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?

6 Answers, 1 is accepted

Sort by
0
Gary Mazur
Top achievements
Rank 1
answered on 02 May 2008, 11:05 PM
I am looking for this too!  ASPMenu/Sitemap is somewhat limited.
0
Peter
Telerik team
answered on 05 May 2008, 07:51 AM
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
0
Gary Mazur
Top achievements
Rank 1
answered on 06 May 2008, 04:15 PM

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

0
Peter
Telerik team
answered on 08 May 2008, 12:56 PM
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
0
Joseph
Top achievements
Rank 1
answered on 16 Oct 2019, 03:27 PM

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!

0
Vessy
Telerik team
answered on 21 Oct 2019, 02:46 PM

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.
Tags
Menu
Asked by
Mitchel
Top achievements
Rank 1
Answers by
Gary Mazur
Top achievements
Rank 1
Peter
Telerik team
Joseph
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or