Guest User

Untitled

a guest
Feb 19th, 2018
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. 1.
  2. $acl = new Zend_Acl();
  3. 2.
  4.  
  5. 3.
  6. // setup the various roles in our system
  7. 4.
  8. $acl->addRole('guest');
  9. 5.
  10. // owner inherits all of the rules of guest
  11. 6.
  12. $acl->addRole('owner', 'guest');
  13. 7.
  14.  
  15. 8.
  16. // add the resources
  17. 9.
  18. $acl->addResource('blogPost');
  19. 10.
  20.  
  21. 11.
  22. // add privileges to roles and resource combinations
  23. 12.
  24. $acl->allow('guest', 'blogPost', 'view');
  25. 13.
  26. $acl->allow('owner', 'blogPost', 'post');
  27. 14.
  28. $acl->allow('owner', 'blogPost', 'publish');
Add Comment
Please, Sign In to add comment