Advertisement
dragonbe

Simple ACL list

May 2nd, 2011
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2. class Application_Model_Acl extends Zend_Acl
  3. {
  4.     public function init()
  5.     {
  6.         $this->addRole('reader');
  7.         $this->addRole('editor', 'reader');
  8.         $this->addRole('copywriter', 'editor');
  9.        
  10.         $this->addResource('stories');
  11.         $this->addResource('edit-stories');
  12.         $this->addResource('publish-stories');
  13.        
  14.         $this->allow('reader', 'stories', 'read');
  15.         $this->allow('editor', 'edit-stories', array ('create','update'));
  16.         $this->allow('copywriter', 'publish-stories', array ('publish'));
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement