tags:

views:

290

answers:

0

I'm using cakePHP ACL feature

I'm trying to achieve this case: User 1 can view project 2 but not project 1

My 'aro' table contcains a record for User::1 And 'aco' has a record for ProjectView::2

in 'aros_acos' table i have inserted a record to store this access permission and set '_read' =1 (rest all permissions are = -1)

But when i check the permisson with :

$id= $project_id;
if($this->Acl->check('User::1', 'viewProject::'.$id, 'read'))
      {
         echo 'read allowed';
      }
      else
      {
         echo 'read disallowed';
      }

It alows the user to view both project 1 and 2.It should only allow view project 2

I dont know where I could be going wrong :( and am really frustrated figuring out the issue