作者:aiminilee | 来源:互联网 | 2023-05-19 06:53
IndjangoadminIhave4usersandasuperuser.IhaveUserswithstaffstatusthathavelimitedac
In django admin I have 4 users and a super user. I have Users with staff status that have limited access and cannot delete/view/edit users but the admin has authority over every other users and models. I do want the superuser to be able to access the users data and edit/modify/delete them but I do not want the superuser to be able to delete himself/herself. Currently the superuser can delete himself. Is there a way to disable the superuser delete by himself/herself in django?? Any help would be grateful.
在django admin我有4个用户和一个超级用户。我的用户具有访问权限受限的用户状态,无法删除/查看/编辑用户,但管理员对所有其他用户和模型具有权限。我确实希望超级用户能够访问用户数据并编辑/修改/删除它们,但我不希望超级用户能够删除他/她自己。目前超级用户可以删除自己。有没有办法在django中禁用超级用户自己删除?任何帮助将不胜感激。
Thanks
谢谢
2 个解决方案