Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend_Acl For Specific Parts Of The Page

I know how to use Zend_Acl to allow certain resources to certain usergroups but how do i use it to allow only specific parts of the page to be shown? For example

I have a button to delete a post via AJAX on the page but i only want to show the button to Admins only. I can use Zend_Acl to block access to the controller post/delete but i can't use it to block the button from showing.

like image 260
BRampersad Avatar asked Dec 13 '25 18:12

BRampersad


1 Answers

// in controller
$this->view->allow_delete_post = $acl->isAllowed($role, 'delete_post');

.

// in template
<? if ($this->allow_delete_post): ?>[button html]<? endif; ?>

Would that not do it?

like image 192
Derek Illchuk Avatar answered Dec 16 '25 09:12

Derek Illchuk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!