0
更精細的ACO
我的產品表:CakePHP的 - 在ACL
select * from products;
+------+----------------+
| id | name |
+------+----------------+
| 1 | product XYZ |
| 2 | product XPTO |
| 3 | procudt ABC |
| 4 | procudt QWERTY |
| 5 | procudt 1234 |
+------+----------------+
我可以允許/拒絕某些用戶組訪問模型「產品」,如:
$group->id = 3;
$this->Acl->deny($group, 'controllers');
$this->Acl->allow($group, 'controllers/Products');
$group->id = 4;
$this->Acl->deny($group, 'controllers');
$this->Acl->allow($group, 'controllers/Products/view');
但如何允許/拒絕某些組訪問某些特定產品,如:
$group->id = 5;
$this->Acl->deny($group, 'controllers');
$this->Acl->allow($group, 'product XYZ');
$group->id = 6;
$this->Acl->deny($group, 'controllers');
$this->Acl->allow($group, 'product XPTO');
$this->Acl->allow($group, 'product 1234');
?