如何在django管理站点上授予用户权限

时间:2021-07-30 20:23:13

I'm trying to give a user limited access to the admin site.

我试着给用户有限的访问管理站点的权限。

I logged in as a superuser, and gave the user staff status and the permissions over a model: "can add", "can change" and "can delete".

我以超级用户的身份登录,并给出用户人员状态和模型的权限:“can add”、“can change”和“can delete”。

如何在django管理站点上授予用户权限

The problem is the user can log in to the site, but sees this message:

问题是,用户可以登录到该网站,但看到以下消息:

如何在django管理站点上授予用户权限

If I give him superuser status he can edit anything, but I want to give him limited access. Is there another option I must check before he can receive rights? I'm using Django 1.6.1.

如果我给他超级用户状态,他可以编辑任何东西,但我想给他有限的访问权限。在他获得权利之前,我还有别的选择吗?我使用Django 1.6.1。

2 个解决方案

#1


1  

I found the problem.

我发现这个问题。

The permissions I was giving the user, were on a model that was not registered to the admin. I was not aware that the permissions will be available even though the model is not registered.

我给用户的权限位于一个没有注册到管理员的模型上。我不知道即使模型没有注册,权限也是可用的。

Thank you for your tips.

谢谢你的建议。

#2


0  

There are a couple of simple things you could check;

有几个简单的东西你可以检查;

user is active? the permissions you want to grant are 'chosen' i.e they appear in the right-hand 'chosen' column?

用户是活跃的?您想要授予的权限是“选择”i。它们出现在右边的“选择”栏吗?

如何在django管理站点上授予用户权限

#1


1  

I found the problem.

我发现这个问题。

The permissions I was giving the user, were on a model that was not registered to the admin. I was not aware that the permissions will be available even though the model is not registered.

我给用户的权限位于一个没有注册到管理员的模型上。我不知道即使模型没有注册,权限也是可用的。

Thank you for your tips.

谢谢你的建议。

#2


0  

There are a couple of simple things you could check;

有几个简单的东西你可以检查;

user is active? the permissions you want to grant are 'chosen' i.e they appear in the right-hand 'chosen' column?

用户是活跃的?您想要授予的权限是“选择”i。它们出现在右边的“选择”栏吗?

如何在django管理站点上授予用户权限