CakePHP ACL 禁用自动 ARO 创建
我(最终)让 ACL 根据组权限正常工作。但是,当我创建一个新用户(用户/添加)时,它会自动创建..我的意思是..自动不方便地创建一个用户ARO.. 虽然这并不是一个大问题,但我希望我的 ARO 表尽可能保持干净。只是我的小组。
通过 CRUD 创建新用户时如何禁用自动创建用户 ARO 对象?
I (finally) got ACL to work properly, based on group permissions. However when I create a new user (Users/add) it automagically.. I mean.. autoinconveniently creates a User ARO..
While this is not really a big problem, I would like my ARO table to stay as clean as possible. Just my groups.
How do I disable the automatic creation of a User ARO object when creating a new user through CRUD?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到了同样的问题,就像你一样,我对自己说“只要它能工作,这没什么大不了的”......但是当我开始拥有越来越多的用户并且当我添加新组时,我发现 ACL无法正常工作。如果您使用基于组的权限,则 AROS 表中必须只有组。
简而言之,文档说您需要如果您想要基于组的 ACL,则在您的 Users 模型中添加
bindNode()
,但他们没有告诉您的是,对于基于组的权限,您的 User 模型不必实现请求者的行为,而你不需要ParentNode() 也不是。把这两个去掉应该就可以了。我在文档中添加了注释,我希望它能够发布:)
祝你好运
i had the same problem and, like you, i said to myself "its not a big deal as long as it's working"... but when i started to have more and more users and when i added new groups, i found that ACL was not working correctly.. If you're using a group-based permissions, you MUST ONLY have groups in your AROS table.
Brief, the documentation says that you need to add the
bindNode()
in your Users model if you want a group-based ACL, but what they don't tell you is that for group-based permissions your User model doesn't have to implement the requester behavior and you don't need the parentNode() neither. Remove those two and it should be ok.I added a note on the documentation, i hope it gets published :)
Good Luck