gpt4 book ai didi

database - 即使在 bindNode 之后,CakePHP 中的 Aros 表仍然包括用户

转载 作者:搜寻专家 更新时间:2023-10-30 19:58:24 27 4
gpt4 key购买 nike

同时按照 CakePHP 书中的说明转到 create an ACL controlled site ,我添加了建议的 bindNode 使其成为“Group-Only ACL”:

//in users model
function bindNode($user) {
return array('model' => 'Group', 'foreign_key' => $user['User']['group_id']);
}

根据 that page ,我的 aros 表应该如下所示:

+----+-----------+-------+-------------+-------+------+------+
| id | parent_id | model | foreign_key | alias | lft | rght |
+----+-----------+-------+-------------+-------+------+------+
| 1 | NULL | Group | 1 | NULL | 1 | 2 |
| 2 | NULL | Group | 2 | NULL | 3 | 4 |
| 3 | NULL | Group | 3 | NULL | 5 | 6 |
+----+-----------+-------+-------------+-------+------+------+

一切都很好 - 我的组权限似乎工作正常......等等,但是当创建用户时,他们仍然被添加到 aros 表中。

正常吗?是否应该添加用户,只是不用于访问目的?我假设我的表看起来就像示例(只有组,没有用户),所以当我开始看到添加用户时,我开始担心了。

最佳答案

在您的用户模型中添加以下行:

public $actsAs = array('Acl' => array('type' => 'requester', 'enabled' => false));

引用: http://cakephp.lighthouseapp.com/projects/42648/tickets/1485-bindnode-still-creating-user-model-aros

关于database - 即使在 bindNode 之后,CakePHP 中的 Aros 表仍然包括用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6154285/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com