var $components = array('Acl');
function anyAction()
{
$aro =& $this->Acl->Aro;
//Here's all of our group info in an array we can iterate
through
$groups = array(
0 => array(
'alias' => 'warriors'
),
1 => array(
'alias' => 'wizards'
),
2 => array(
'alias' => 'hobbits'
),
3 => array(
'alias' => 'visitors'
),
);
//Iterate and create ARO groups
foreach($groups as $data)
{
//Remember to call create() when saving in loops...
$aro->create();
//Save data
$aro->save($data);
}
//Other action logic goes here...
------------------------------
I try to verify the tree structure using
cake acl view aro
in cake console, I get the error:
~~
Error: aro not found
No tree returned.
~~
Someone help to see where's wrong?
I'm supposed to see:
Aro tree:
---------------------------------------------------------------
[1]warriors
[2]wizards
[3]hobbits
[4]visitors
---------------------------------------------------------------
Am I right ?
Regards,
Maxim
On Dec 30, 6:07 pm, John Maxim <goog...@gmail.com> wrote:
> Hi Jon, thanks.
>
> But I tried earlier I got an error stating:
> ~~
> Error: aro not found
> No tree returned.
> ~~
>
> I typed cake acl view aro
>
> ~~
> Thanks,
> Maxim
> On Dec 30, 5:52 pm, Jon Bennett <jmbenn...@gmail.com> wrote:
>
> > >http://book.cakephp.org/view/1245/Defining-Permissions-Cake-s-Databas...
>
> > > Where do we put this script ?
>
> > It's a controller method (though you could put it in a cake shell as
> > well). You could either stick it in an existing controller (say
> > users_controller as that will have the required models already) or
> > create a new one specifically for it.
>
> > hth
>
> > j
>
> > > var $components = array('Acl');
>
> > > function anyAction()
> > > {
> > > $aro =& $this->Acl->Aro;
>
> > > //Here's all of our group info in an array we can iterate through
> > > $groups = array(
> > > 0 => array(
> > > 'alias' => 'warriors'
> > > ),
> > > 1 => array(
> > > 'alias' => 'wizards'
> > > ),
> > > 2 => array(
> > > 'alias' => 'hobbits'
> > > ),
> > > 3 => array(
> > > 'alias' => 'visitors'
> > > ),
> > > );
>
> > > //Iterate and create ARO groups
> > > foreach($groups as $data)
> > > {
> > > //Remember to call create() when saving in loops...
> > > $aro->create();
>
> > > //Save data
> > > $aro->save($data);
> > > }
>
> > > //Other action logic goes here...
> > > ------------------------------
>
> > > Can someone point this out ?
>
> > > Thanks. Regards,
> > > Maxim
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions.
>
> > > 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+unsubscribe@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en
>
> > --
> > jon bennett -www.jben.net-blog.jben.net
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment