Note that there are some explanatory texts on larger screens.

plurals
  1. POCakephp 2.0 row/record-level Acl
    text
    copied!<p>i am messing around with the cakephp 2.0's access lists, so far i created a very simple example following the documentation.</p> <p>I have set up a users table and the most important functions like index, add, login ecc. and is related to a groups table (every user belongs to a group).</p> <p>I've also created a "houses" table wich contain different contents (houses).</p> <p>Then i've set up auth in combination with the acl-component in crud mode, including the aco and aro tree.</p> <p>So far so good, everything is working so far, i can allow or deny single actions for every user. But, i want further access control, that for instance a user can manage only a specific house. So i've set up an aco for every house, allowed only read-access to the houses to the user and allowed update access only for the desired house. But it won't work! No matter what i do.. i don't get access to the edit action. Here my trees:</p> <pre><code>Aco: [1] Houses [5] House.1 [6] House.2 [2] Users Aro: [1] superadmin [4] User.1 [1] admin [5] User.2 [7] User.4 [3] customer [6] User.3 </code></pre> <p>And finally the aros_acos table:</p> <pre><code>id aro_id aco_id _create _read _update _delete 4 1 1 1 1 1 1 5 1 2 1 1 1 1 6 2 1 1 1 1 1 7 3 1 0 1 0 0 8 7 1 -1 1 1 -1 9 7 5 1 1 1 1 </code></pre> <p>Fact is, that, if i try to do a quick check with:</p> <pre><code> var_dump($this-&gt;Acl-&gt;check( array('model' =&gt; 'User', 'foreign_key' =&gt; 4), array('model' =&gt; 'House', 'foreign_key' =&gt; 1), 'update')); </code></pre> <p>It gives back true!</p> <p>Strange... Am i doing something wrong? Is there any way to decently debug the acl component (with information wich acos and aros the component is checking, seeing ecc.)?</p>
 

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