Altering visibility with CakePHP ACL

From Birnam Designs Wiki

Jump to: navigation, search

In order to pass a boolean value from controller to view, in order to dictate the visibility of a particular element in relation to an ARO/ACO:

$user = $this->Auth->user();
$aco = $this->params['controller'];
$this->set('show_something', $this->Acl->check($user, "$aco/action", '*'));
Share This!
This page was last modified on 17 April 2010, at 21:06. This page has been accessed 343 times.