3,035
edits
No edit summary |
|||
| Line 26: | Line 26: | ||
* aclException checks | * aclException checks | ||
* user->group map is a many-to-many relationship using a map table instead of a simple group_id injected into the users table | * user->group map is a many-to-many relationship using a map table instead of a simple group_id injected into the users table | ||
== Using Permissions in Controllers == | |||
Since ACLs are turned on from app_controller you pick up permissions for free based on Controller:action. For example, if you're in the Images controller and you're adding an image with the add() action, SimpleAcl will just check group and user permissions for Images:add automatically and deny the user access if it fails. | |||
There is a way to do a manual check using the SimpleAcl component. If you're wanting to use it for display logic or some other use that requires and explicit check, you may need to use this method: | |||
// Check to see if the user has access to the entire Reviewers controller. | |||
if ($this->SimpleAcl->actionAllowed('Reviewers','*')) { | |||
// Do something | |||
} | |||
== Disabling Permissions in Controllers == | == Disabling Permissions in Controllers == | ||
edits