how to create aro using dbAcl using console

Posted by Praveen kalal on Stack Overflow See other posts from Stack Overflow or by Praveen kalal
Published on 2010-04-30T07:04:40Z Indexed on 2010/04/30 7:07 UTC
Read the original article Hit count: 242

Filed under:

hi i am using cakephp for my project but whille creating acl using command promt. when i run the following command cake schema run create DbAcl it genrate three tables in database. but after puting the following code in users_controller.php. and this command. cake acl view aro it dont create aros.

function index() {

$aro =& $this->Acl->Aro;
//pr($aro); exit;
//Here's all of our group info in an array we can iterate through
$groups = array(
    0 => array(
    'alias' => 'admins'
    ),
    1 => array(
    'alias' => 'guests'
    ),
    2 => array(
    'alias' => 'mangers'
    )
);

//Iterate and create ARO groups
foreach($groups as $data)
{
    //Remember to call create() when saving in loops...
    $aro->create();
    //Save data
    $aro->save($data);
}
       }

© Stack Overflow or respective owner

Related posts about cakephp