[eluser]PhilTem[/eluser]
A role is a group but it isn't a group, too.
From google (query "define role") we get
Quote:The function assumed or part played by a person or thing in a particular situation.
That's what you should keep in mind when you think of roles. Of course, in a simple setup you can say role == group, but if you want to have permissions defined more precise, you should use roles instead of groups as "thinking of".
I always think of roles like this:
A role is a set of permissions the users assigned are allowed to perform or a set of resources the users may access.
So to speak, I usually split up my ACL in three parts:
- Resources (what can be accessed)
- Roles (what we are trying to clarify, what it is)
- Permissions
- Users (but they don't really count for an ACL here)
So, you set up resources (something that may be access like 'admin.users.add') and add roles (something like 'Administrators', 'User managers', ...). Then you combine these resources with the roles and assign 'allow' or 'disallow' to them. Which leads you to the 'permissions'.
The last step is actually to assign roles to users (I'd say, you assign roles to users and not users to roles. If you assigned users to roles you'd actually have groups). That way the users get all the permissions granted to each role they own. Any permission not assigned is either given by the defined parent role or - if no permission can be found - denied by default.
That's the way I see and use an ACL for my projects. There are other approaches, but for me, this one works pretty freakin' awesome and is failsafe.