I am trying to use ACL in new 1.2.
It seems to me that in check method (http://tinyurl.com/ywr9nu) on
line 282 should be something like this:
for ($i = 0; $i <= count($aroPath) - 1; $i++) {
rather than:
for ($i = count($aroPath) - 1; $i >= 0; $i--) {
Now Acl is checking from the roots to leafs of AROs and ACOs trees.
IMHO it should be done inversly.
When I do something like this (Acl tables are now empty):
//creating acos
$this -> Acl -> Aco -> create(array('alias' => 'controllers'));
$this -> Acl -> Aco -> save();
$this -> Acl -> Aco -> create(array('alias' => 'someController',
'parent_id' => 1));
$this -> Acl -> Aco -> save();
//creating aros
$this -> Acl -> Aro -> create(array('parent_id' => null, 'alias' =>
'Users'));
$this -> Acl -> Aro -> save();
$this -> Acl -> Aro -> create(array('parent_id' => 1, 'alias' =>
'Admin'));
$this -> Acl -> Aro -> save();
//assigning privileges
$this -> Acl -> deny('Users', 'controllers');
$this -> Acl -> allow('Users/Admin', 'someController');
//creating some user who is children of Users/Admin
$this -> Acl -> Aro -> create(array('parent_id' => 2, 'alias' =>
'User.Someone'));
$this -> Acl -> Aro -> save();
And when I do $this -> Acl -> check('User.Someone', 'someController');
I am getting false, but I should be getting true...
What do you think about it? I hope I am not wrong about the whole ACL
idea... ;)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---