I need to implement flexible AND simple (if such thing exist) and at the same time utilize built-on means if possible
So far I have MembershipProvider and RoleProviders implemented. This is cool but where do I go next?
I feel like I need to add term "Priviledge" and than hardcode those inside application. Users will configure roles to add Privilidges to Roles and assign Roles to users.
Does that sound like a good model? Should I think about adding priviledges at User level on top of adding them to Roles? I might but I envision problems with setup (confusing) and following support.
If I don't do that and some specific users will need lesser priviledges - admin will have to create another role, etc..
Any silver bullet for system like this? And why Microsoft didn't go further then just Membership and Role providers?
Another idea: Leave Roles as "priviledge" holder and hardcode them. Then I can code to those roles inside app using all available markups/attributes, etc - all Microsoft.
Add new entity "Group" and create relationship like this
- Users
- UserGroups
- Groups
- RoleGroups
- Roles
This way I can collect Roles into groups and assign those groups to Users. Sounds great and matches other software patterns. But then I can't really implement things inside RoleProvider like:
- AddUsersToRoles
- RemoveUsersFromRoles
And some things do not really make sense anymore because they will be hard-coded
- DeleteRole
- CreateRole