We always have problems to using role-based in large systems. In such softwares we want superusers to able to set their organization users permissions. We can create many atomic roles and create a console for assigning the roles to the users. Then we have to create many roles, for example:
AddProduct, RemoveProduct, EditProduct, AcceptPurchase, DenayPurchase, ...
In this way, for a medium system we should have at least 50 roles! Then how the admin can assign these roles for each user?
We have two solution at first glance:
To create a table in DB (for example Group) to put between the users and roles. Then admin should create a group of roles then assign a group to multiple user.
Use roles as a group of permissions. For example create a PermissionInRoles table and assign the permissions for each roles then assign the roles to the users.
We soon find the first approach nonsense. And we implement several project with second approach. But now we want to use it in a sivlerlight project besides the WCF RIA Authentication services. It just supports the roles. For example each user instance has an IsInRole method which we implement our IsInPermission method instead.
There is another problem when using RequiresRole attribute for services. I can't and I don't want to put a hardcode role name for each service method.
Know we are so confused about the role-based security design! How can we use it in these situations?