You're passing a class instance to allow(). It should be an array:

array( 'model' => 'Group', 'foreign_key' => $the _group_id)

On Tue, Oct 6, 2009 at 3:28 PM, Manu <manu...@gmail.com> wrote:
>
> hi
>
> I try to add permissions with this functions.
>
> function initDB() {
>    $group =& $this->User->Group;
>    //Allow admins to everything
>    $group->id = 1;
>    $this->Acl->allow($group, 'controllers');
>
>    //allow managers to posts and widgets
>    $group->id = 2;
>    $this->Acl->deny($group, 'controllers');
>    $this->Acl->allow($group, 'controllers/Posts');
>    $this->Acl->allow($group, 'controllers/Widgets');
>
>    //allow users to only add and edit on posts and widgets
>    $group->id = 3;
>    $this->Acl->deny($group, 'controllers');
>    $this->Acl->allow($group, 'controllers/Posts/add');
>    $this->Acl->allow($group, 'controllers/Posts/edit');
>    $this->Acl->allow($group, 'controllers/Widgets/add');
>    $this->Acl->allow($group, 'controllers/Widgets/edit');
> }
>
>
> I really only try to do the acl tutorial but I cant get it done.
> you can see the code on the doc site tutorial ACL.
> The get a warning when I try to allow or deny.
>
> On Oct 6, 7:43 pm, brian <bally.z...@gmail.com> wrote:
>> On Tue, Oct 6, 2009 at 9:42 AM, Manu <manu...@gmail.com> wrote:
>>
>> > Hi
>>
>> > I'm trying to do the acl tutorial from the cake docs.
>> > Unfortunately I can't edit the permissions.
>> > When I try to setup the permissions I get this warning.
>>
>> > Warning (512): DbAcl::allow() - Invalid node [CORE\cake\libs\controller
>> > \components\acl.php, line 325]
>>
>> > I also tried to set up permissions with the console tool. But I get
>> > the same warning. I also tried different nodes and
>> > it doesn't matter if I try to allow or deny.
>> > I have the entries in the tables. I setup groups and users and I also
>> > have the acos which I added with the build acl function from the
>> > tutorial.
>>
>> > maybe It has something to do with my Apache, PHP or mysql
>> > configuration.
>> > I just installed everything and maybe I missed something.
>> > I have apache http server 2.2 with php 5.2.11.
>>
>> > any ideas ?
>>
>> Can you post your code? The error is triggered because Cake can't find
>> the association between nodes. Look at DbAcl::getAclLink(() in the
>> AclComponent file.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to