Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- $acl = new Zend_Acl();
- 2.
- 3.
- // setup the various roles in our system
- 4.
- $acl->addRole('guest');
- 5.
- // owner inherits all of the rules of guest
- 6.
- $acl->addRole('owner', 'guest');
- 7.
- 8.
- // add the resources
- 9.
- $acl->addResource('blogPost');
- 10.
- 11.
- // add privileges to roles and resource combinations
- 12.
- $acl->allow('guest', 'blogPost', 'view');
- 13.
- $acl->allow('owner', 'blogPost', 'post');
- 14.
- $acl->allow('owner', 'blogPost', 'publish');
Add Comment
Please, Sign In to add comment