django 中的员工、管理员、超级用户有什么区别? [英] What's the difference between staff, admin, superuser in django?

查看:38
本文介绍了django 中的员工、管理员、超级用户有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Django 拥有超级用户、员工、管理员……

Django has superuser, staff, admin…

超级用户和工作人员在 django.contib.auth.models.UserManager 中.然后是django-admincreatesuperuser命令.

superuser and staff are in django.contib.auth.models.UserManager. Then there is the createsuperuser command of django-admin.

嗯,有管理应用……有什么区别?

Well, there are admin apps… What's the difference?

推荐答案

我取自 Django 文档:

I take this from Django Documentation:

Django 最强大的部分之一是自动管理界面.最好的事情是您可以轻松自定义它.

One of the most powerful parts of Django is the automatic admin interface. Best thing is that you can customise it easily.

如果以超级用户身份登录,您可以创建、编辑和删除任何对象(模型).

If logged in as a superuser, you have access to create, edit, and delete any object (models).

您可以使用人员标志创建人员用户.员工"标志控制是否允许用户登录管理界面(即,该用户是否被视为您的员工"组织).由于可以使用相同的用户系统来控制访问公共(即非管理员)站点,此标志区分公共用户和管理员之间.

You can create staff user using staff flag. The "staff" flag controls whether the user is allowed to log in to the admin interface (i.e., whether that user is considered a "staff member" in your organization). Since this same user system can be used to control access to public (i.e., non-admin) sites, this flag differentiates between public users and administrators.

普通"管理员用户——即活跃的非超级用户员工——通过分配的权限被授予管理员访问权限.每个对象通过管理界面可编辑具有三个权限:创建权限、编辑权限和删除权限您创建的模型.

"Normal" admin users – that is, active, non-superuser staff members – are granted admin access through assigned permissions. Each object editable through the admin interface has three permissions: a create permission, an edit permission and a delete permission for all the models you had created.

Django 的管理站点使用一个权限系统,您可以使用它来授予特定用户只能访问他们所访问的界面部分需要.当您创建一个用户时,该用户没有权限,它是由您来授予用户特定权限

Django’s admin site uses a permissions system that you can use to give specific users access only to the portions of the interface that they need. When you create a user, that user has no permissions, and it’s up to you to give the user specific permission

这篇关于django 中的员工、管理员、超级用户有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆