My application has the following definitions:
- Users (Roles)
- Accounts/Items (Resources)
- Full/List/View/Update/Delete (Accesses)
- Account IDs (Resource IDs - each account has a unique ID...)
Issue:
- Acls seem to only take into account Roles, Resources, Accesses. What about accesses on specific Resources designated by a resource_id?
- The entire Acl is in the database using the incubator's Acl Database Adapter, not in memory.
Objective:
To allow/deny each user the ability to perform "access" on a specific "resource" identified by "resource_id"
Example: We have 10 accounts. Account ids 1 - 10.
- User1 has full access to Accounts 1 - 5
- User2 has full access to Accounts 6 - 9
- User3 has full access to Accounts 10
- User3 can also List/View Accounts 2, 5, 9.
// Doesn't take into account the account_id!!
if(!$this->isAllowed('User1', 'Account', 'View')) {
... Denied! ...
return false;
}
... approved ...
Possible solution:
I've been toying with the idea of extending the Acl Database Adapter by adding a "resource_id" column to the access_list and updating the code to check that as an additional parameter.
What are your thoughts?