Django:行级权限是针对实例特定规则的,还是关于视图的?
抱歉标题令人困惑。我试图让它不那么冗长,但是......
我想知道的是: Django 的新 row级别权限 (a) 修复多租户应用程序带来的设计问题(我不是指多个用户,而是指使用相同 db/db 模式的多个实例),还是 (b) 只是更复杂的权限版本,允许您根据标准用户和身份验证应用程序的规则在行级别管理权限。
(即,我想限制此帐户对对象 a、b、c 的访问,以及此帐户对 d、e、f 的访问,VS 用户可以访问博客文章的标题,但不能访问内容)
Sorry for the confusing title. I tried to make it less verbose, but...
What I'm wondering is: Does Django's new row level permissions (a) fix the design problem that comes with multi-tenant applications (I don't mean multiple users, but rather multiple instances working with the same db/db schema), or is it (b) just a more complex version of permissions that allows you to manage permissions at the row level based on the standard User and Auth apps' rules.
(ie, I want to limit access to objects a, b, c to this account, and d, e, f to this account VS a user can access the title of a blog post but not the content)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
django-authority 让您可以使用相同的语法来实现行级权限和 django 的表级权限。所以它允许你限制用户A、B只能对对象C进行操作,而不能对D进行
操作。限制对字段级别(标题、内容)的访问更加细化,这里无法处理。
django-authority let's you implement row-level permissions along with django's table-level permissions using the same syntax for both. So it allows you to restrict users A, B to operate only on object C, but not D.
Restricting access to the field-level (title, content) is even more granular and cannot be handled here.