Hello,
Is there any way to show/hide menu items and/or html elements based on the permissions the users has?
For example, if the user doesn't have the permission BookStore_Author_Create then the books list shouldn't be shown to him. Or when the user doesn't have the permission to create a new book, then the Add button shouldn't show.
Currently, when the list page is visited, the error message "You are not authorized" shows. What would be better is to hide the menu item all together.
Thank you!
Is manually using the AuthorizationService both in the menu contributor and views the best approach?
You can refer to TenantManagement.
Most helpful comment
You can refer to
TenantManagement.https://github.com/abpframework/abp/blob/a9a9cf2ef02107ba3b56a48308297d99a0d00789/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.cshtml#L32
https://github.com/abpframework/abp/blob/a9a9cf2ef02107ba3b56a48308297d99a0d00789/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Navigation/AbpTenantManagementWebMainMenuContributor.cs#L27