Introduction
I am designing my application role-permission-based access system. In my system I have the following roles:
- Root
- Office manager
- Auditor
- Customer
- Worker
For example, lets view the users relations with 'task' entity.
Worker and Customer are quite special roles, they will have almost read-only access to their own tasks. Workers will see only few properties of the 'task' object. Depending on system business rules, in some cases they will be able to update one or two properties.
Root user can do everything, it can create, update, read, delete 'tasks'. Office manager can list, update and create 'tasks'. Auditor can only list tasks.
Root, Auditor and Office manager will have access to same (full) set of 'task' entity properties. This three user types will access system via same management interface (web app module).
Customers will access system via separate role-oriented module (customer module), functionality is too specific. Workers - too (worker module).
So, using the described example, we can say that we can create the following permissions for Root, Auditor and Office manager:
- LIST_TASKS
- CREATE_TASKS
- UPDATE_TASKS
- DELETE_TASKS
This will work for them, but not for Customer and Worker. For Worker we could do:
- LIST_WORKER_OWN_TASKS
- UPDATE_WORKER_TASK_STATUS
... and so on.
But this makes quite low sense, as for me. Noone else but Worker will use this permissions. Also, the conditions when Worker will be able to edit certain properties of 'task' entity can not be described using permissions.
Summary
So, I make a conclusion, that I need a mixed access control system. Customers and Workers will be roles without any permissions. Root, Auditor and Office manager will be roles with set of permissions binded to each role.
Finally , we can call such mechanism mixed permissions-and-role based access system.
Question
Is it a normal to have such design? Am I thinking wrong way? Or it is better to describe Customer and Worker logic (as much as possible) using very detailed list of permissions?