Persistent Roles #1505
Replies: 1 comment 2 replies
-
After a sleeping on this idea I have decided maybe I need to give a bit of a better overview of what my idea of this is The idea of this is to be able to easily register a policy within piranha that is persistent in that it cant be deleted within the piranha roles manager section or it can be deleted but has a separate permission to do so. Use CaseThe project I am currently working on as stated above uses a front end login and register system and registered users are assigned a default role upon email confirmation. What I want to be able to achieve is to stop my client who will potentially be using the manager from being able to delete this role or others such as 'SysAdmin' as when these roles are delete the users assigned to these roles are removed from the role which makes sense but this could cause some problems if 'SysAdmin' is removed from the roles as you will loose backend access if no other role is configured for this and if my default role users are assigned on email confirmation is removed this could be a pain to go through and re-add all registered users back to this role especially with larger user sets. I know I could create a role with all permissions except the delete role permission but I still want to be able to allow them to create and delete roles as needed. The way I currently have it set up as above with obviously still allow them to delete the role it just ensures its recreated. I am still currently trying to come up with a solution to fix this |
Beta Was this translation helpful? Give feedback.
-
Not sure if this already exists within piranha and ive just missed it somehow but I am currently working on a project that has a public login and register system. I want to be able to assign the user to a role when they register so I want to ensure that the role and required permissions are always set up similar to how 'SysAdmin' is setup in the seed of the IdentityDbContext.
Currently I have implemented this in a module I have created by creating an extension of the IDB interface from Piranha.AspNetCore.Identity
The permissions and policies have been setup in the same way the module template does.
This is probably not the best way to implement it but what I come up with at the time using the source code as an example. Wondering if this is something worth adding as a piranha feature obviously in a more OOP manner?
Beta Was this translation helpful? Give feedback.
All reactions