Hi,
Hope you are well.
We want to implement dynamic permissions within our application and I wanted to find out if this is possible and/or if you can share any resources of how one could achieve this?
The scenario:
When adding a specific entity (eg. Category), we want to dynamically create a permission associated with this specific entity.
With a "normal" implementation, we would create the entity and "manually" create permissions for CRUD operations of the entity in the AppAuthorizationProvider
. However, we want to give the users the ability to create/update/delete their own "categories", but we still want to associate permissions with that "category" in order to manage who will be able to use that "category".
I have found the following blog posts, but the examples mentioned is not 100% clear:
- https://support.aspnetzero.com/QA/Questions/12245/Dynamic-Permission
- https://support.aspnetzero.com/QA/Questions/12214/Add-a-new-permission-from-the-database-in-SetPermissions-method-in-the-AppAuthorizationProvidercs
- https://support.aspnetzero.com/QA/Questions/11619/ChangeAddRemove-Role-Permission-Tree-Root-Menu-Item-Dynamically
Any assistence with regards to this question is much appreciated.
Kind regards, Robert