我遵循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