Django admin - 通过权限限制用户查看
我开始学习 Django,我有一个问题。
有什么办法可以限制管理界面中的视图吗?我看到有“更改”、“添加”和“删除”权限,但我也想限制视图。
例如:两个用户,“用户 1”是超级用户,“用户 2”在编辑组中。用户 1 有可以访问所有内容,但用户 2 无法在管理中查看指定的应用程序,
这可能吗?
I'm starting to learn Django and I have a question.
Is there any way to restric views in the administration interface? I see there are "change, "add" and "delete" permissions, but I wanted to restrict views also.
For example: Two users, "User 1" is superuser and "User 2" is in the editor group. User 1 has access to everything, but User 2 can't view a determined application in the administration.
Is that possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您确保用户 2 对与您想要隐藏的应用程序相关的任何模型没有权限(因此不会更改、添加或删除该应用程序中任何模型的权限),那么它不会出现在管理中对于用户 2。
If you make sure that User 2 has no permissions for any model related to the app you want to hide away (so no change, add or delete powers for any of the models in that app), then it won't appear in the admin for User 2.