SHARE
TWEET

Untitled

a guest Jun 19th, 2017 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $acl = new Zend_Acl;
  2. $acl->addResource('resource1');
  3. $acl->addResource('resource2');
  4. $acl->addResource('resource3');
  5. $acl->addRole('user');
  6. $acl->addRole('admin', 'user');
  7. $acl->deny();
  8. $acl->allow('user', 'resource1');
  9. $acl->allow('admin', 'resource2');
  10. $acl->allow('admin', 'resource3');
  11.  
  12. $acl->isAllowed('admin', 'resource1'); // Returns bool true
  13. $acl->isAllowed('user', 'resource2'); // Returns bool false
RAW Paste Data
Top