I have not tested it or have not used it before, but I can present one way:
You have a model Userand a model Group, and User HATBM GroupShaz Amjad notes.
At the moment when you perform your access control, select the list of all groups to which the user belongs (possibly using bindModel).
Then, something like:
$permits = array();
foreach ($thisUsersGroups as $group) {
$permits[] = $this->Acl->check($group, 'myclass', 'update')
}
If it $permitscontains at least one true, they must be allowed.
There may be a better or more automatic way to do this, but I do not see that this should not work in principle.
source
share