限制通过应用程序访问 django admin
是否可以限制用户能够查看和修改的管理页面我知道目前可以限制对它们的更改,但是是否可以通过权限或其他方式限制用户仅访问一个应用程序的管理视图。如果可能的话,我也希望超级用户可以访问标准的 django admin
环顾文档,看起来 AdminSite 是我应该去的地方
Is it possible to limit what admin pages a user is able to VIEW and modify i know it is currently possible to limit changes to them, but is it possibly to limit a user via permissions or otherwise to only the administration views for one app. If possibly i am also aiming that superusers can access the standard django admin
Looking around in the docs it looks like AdminSite is where i should be headed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 django 权限系统确实可以。 查看。您可以轻松地将其扩展到您自己的观点。
您所要做的就是在 django admin 中创建一个组,仅删除/授予您想要允许的组的权限。然后将所需的用户分配到该组。
请记住,权限还单独限制“添加/更改/删除”。但仅适用于限制整个对象类型的权限,而不适用于特定对象。
快乐编码。
It is indeed possible using django permission system. Check out. You can easily extends this to your own views.
All you have to do is create a group in django admin, remove/give it permission for only those you want to allow. And then assign the desired user to this group.
Remember, permission also limits 'add/change/delete' separately. But works only to limit permissions on type of objects as a whole and not on particular objects.
Happy Coding.