Syntax
$this->Acl->check(array(
'model' => 'ModelName', # The name of the Model to check agains
'foreign_key' => $foreign_key # The foreign key the Model is bind to
), 'Controller/action'); # The controller and action to check the permissions for
Which results in the following call:
As a User
$this->Acl->check(array(
'model' => 'User',
'foreign_key' => $userId
), 'Posts/index');
As a Group
$this->Acl->check(array(
'model' => 'Group',
'foreign_key' => $groupId
), 'Posts/index');
I wrote it down including some linebreaks for readability.
More info at: