开发者

how to create aro using dbAcl using console

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);
}
       }


In order to create your AROs you need to create a view for your index method in the UsersController and after that visit Users/index in your browser. Only after that call cake acl view aro from console. If that doesn't help try to use this tool. It provides user friendly way to create your aros (groups and users) and acos (menus) and manipulate them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜