Hi, what is the recommended approach to define Menu at the top from code or database and give permission to UserRoles?
I have different UserRoles which should get access to only a subset of menu items Currently the menu is hardcoded - but I need to give certain UserRoles permissions
- To open / see / read a page
- To insert data
- To update data
- To delete data
Is there any documentation for an implementation - I think also other dev have same requierments, THANKS
2 Answer(s)
-
0
If what you need is use ASP.Net Zero's default menu system you can check https://docs.aspnetzero.com/en/aspnet-core-mvc/latest/Features-Mvc-Core-Main-Menu-Layout
Or, If what you need is store your menu items somewhere else or change its filter method, you can override UserNavigationManager. aspnetboilerplate/UserNavigationManager.cs
Create a new class inherited from IUserNavigationManager and replace it with the existing one.
Configuration.ReplaceService<IUserNavigationManager, MyUserNavigationManager>();
-
0
Thanks!