Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to organize and manage an ACL?
    primarykey
    data
    text
    <p>Taking the <a href="http://framework.zend.com/manual/en/zend.acl.html" rel="nofollow">Zend_ACL</a> as my example, I'm wondering how this should be organized for a project. Sure the example is all nice and neat, but a real site is much more complex.</p> <pre><code>$acl = new Zend_Acl(); $acl-&gt;addRole(new Zend_Acl_Role('guest')); $acl-&gt;addRole(new Zend_Acl_Role('member')); $acl-&gt;addRole(new Zend_Acl_Role('admin')); $parents = array('guest', 'member', 'admin'); $acl-&gt;addRole(new Zend_Acl_Role('someUser'), $parents); $acl-&gt;add(new Zend_Acl_Resource('someResource')); $acl-&gt;deny('guest', 'someResource'); $acl-&gt;allow('member', 'someResource'); echo ($acl-&gt;isAllowed('guest', 'someResource') ? 'allowed' : 'denied'); </code></pre> <p>Given that each controller/page on my site will have some kind of access checking I need the rules to be globally available. Does this mean that I need to create a massive config file or class to setup all the rules on load? Wouldn't that waste a lot of memory?</p> <p>Yet if I only setup the rules needed for each controller that would defeat the purpose of the ACL right? The main reason for using a ACL is to avoid having permissions spread throughout the codebase like this:</p> <pre><code>Admin_Controller { public function action() { if($user-&gt;role !== 'admin') { die('not allowed'); } } } </code></pre> <p>What about changes? What if the ACL rules are stored in a database where an administrator can easily change permissions. Should they all be downloaded each page request? Wouldn't that put a large burden on the system?</p> <p><strong>In short, how does an ACL work on a large site? What problems occur? How are cascading permissions handled?</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload