Im developping an application that has many users and can share some interfaces, the problem is some users don't have the same actions. for example they can view a category list and for example in the page /category/index there's a crud operation. the problem that some users can delete a category,and others can update it.so i want to hide those links based on role permission without testing in the servers like this:
$this->set("isedit",false);user has no access to edit
if($this->Acl->check(array('User' => array('id' => $this->User->id)), 'Category/edit'))
$this->set("isedit",true);
and in the page i test the isedit variable if set to false and i hide the button or the link like this
<?php
if($isedit)://je teste si l'utilisateur a le droit d'editer un utilisateur
echo $this->Html->link(__( 'Edit' ), array( 'controller'=>'categories','action' => 'edit', $user['Category']['id']), array( 'class' => 'btn btn-info' ));
endif;
?>
is there a way that i can do that in the $this->Html->link
Thanks in advance