Hi there all,

Just started using ACL and everything is ok up to now.

I can restrict pages for specific users. For example a *guest *user gets an
error if he/she clicks the edit button.

Now I want to hide this edit button for * *users who don't have edit
permission. Which one is a better approach;

*1.check ACL in view script   *

$roleName = Zend_Auth::getInstance()->getIdentity()->role;
$acl = Zend_Registry::get('acl');
if($acl->isAllowed($roleName,'post','edit')){
// echo edit button ...
}

*2. check it in the controller and pass a flag to view*


If you think it is better in view script would you suggest a better code?

Thanks

Serkan

Reply via email to