有没有办法通过 Django 中的模型属性来管理管理面板编辑权限?

发布于 2025-01-18 12:21:52 字数 334 浏览 4 评论 0原文

因此,我希望能够使用模型属性值控制Django管理面板中模型的写入权限。

这是一个示例:我们有一个名为组织的模型,属性 is_production 是布尔值。另外,我们有两个角色:开发人员客户支持。我希望来自开发人员组的用户能够使用is_production = false客户支持的用户能够使用is_production = true。是否有一种无代码 /低编码的方式来执行此操作,例如扩展 / Django电池?

感谢您的时间!

So, I want to be able to control write permissions for a model in Django admin panel using model property value.

Here's an example: we have a model called Organization with property is_production, which is boolean. Also, we have two roles: Developers and Customer Support. I want users from Developers group to be able to edit Organizations with is_production = False, and users from Customer Support to be able to edit ones with is_production = True. Is there a no-code / low-code way to do it, like an extension / Django battery?

Thanks for your time!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文