I know how to use Zend_Acl to allow certain resources to specific user groups, but how can I use it to show only certain parts of the page? for instance
I have a button for deleting a message via AJAX on the page, but I want to show the button only to administrators. I can use Zend_Acl to block access to the message / delete the controller, but I cannot use it to block the button from showing.
// in controller $this->view->allow_delete_post = $acl->isAllowed($role, 'delete_post');
.
// in template <? if ($this->allow_delete_post): ?>[button html]<? endif; ?>
Is this really not so?
ACL, script.
ACL , , , ACL , - ...
if(My_Custom_Acl::getIsAllowed('some_resource', 'delete_post_action'){
getIsAllowed(), ACL .
,
, . DRY, 200 / , - , $this- > render ('view') $this- > render ('edit' ) . script . , , , . , , , ACL ...
Source: https://habr.com/ru/post/1763393/More articles:Will the iphone 3gs app work on iphone 4? - objective-cRegular expression, how to search () and replace with [] - javascriptScala actor flow control - androidHow to write a ruby-regular expression that removes characters only in the first and last positions? - ruby | fooobar.comPrinting a random number returns a negative number. (/ DEV / urandom) - cкак создать обработчик событий для динамического выпадающего списка в С# - c#Access Picasa with Android - Google Data API - androidDelphi library for MIDI input / output? - delphiCMU: Semaphores - semaphoreIs the composition bad for verification? - c ++All Articles