This is a case where you should be using:
$this->Acl->check('aro_alias', 'CamelCaseController', 'crud action');
So, in your case, to find out if the logged in user 'henry' should be
able to access /votes/restart, and you have mapped restart to
'update', then you do this:
if( $this->Acl->check('henry', 'Votes', 'update') ){
$this->set('display_restart', TRUE);
} else {
$this->set('display_restart', FALSE);
}
On May 29, 11:50 am, mcjustin <[EMAIL PROTECTED]> wrote:
> I'm setting the following in one of my controllers' beforeFilter()
> function:
> Auth->authorize = 'crud'
> $this->Auth->mapActions(
> array('show'=>'read',
> 'restart'=>'update',
> ));
>
> I was planning to check the following in the 'index' action before
> presenting a link to the 'restart' action.
> Auth->isAuthorized('crud', 'restart', 'aroX');
>
> But in 'crud' mode, Auth->isAuthorized ignores the second param, and
> simply checks the Acl for the current action ($this->params['action']). I
> thought the intention of 'crud' mode was to be
>
> check actions of various names against the CRUD access defined in the
> Acl; I'd like to do that in the index action before I present links to
> other actions.
>
> I've worked around this by adding a 'crudForAnyAction' case to the
> isAuthorized method, but it seems that perhaps I'm using this multi-
> headed beast improperly...
>
> Any advice would be greatly appreciated!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---