我遵循Acl示例中的蛋糕手册。
当成功,我有申请 Acl来我的项目更多的问题
如何限制用户访问他自己的信息
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');
//we add an exit to avoid an ugly "missing views" error message
echo "all done";
exit;
}
在代码
1.How来限制用户访问自己的
2.我的唯一信息需警惕拒绝用户时访问行动
3.当登录任何角色,我不能接取注销行动
谢谢
OMG它看起来会更难下一步 我也明白了ACL并不多 你能解释一下我要ACL和Permissionable – bubbleman 2011-05-31 11:52:23