How I can list the group table with their respective group permissions and permissions?
如何列出组表及其各自的组权限和权限?
1 个解决方案
#1
0
The relevant tables for the Auth Django contrib app, which contains users and groups and their respective permissions are named as follows in the db:
Auth Django contrib应用程序的相关表(包含用户和组及其各自的权限)在db中命名如下:
auth_group
auth_group_permissions
auth_permission
auth_user
auth_user_groups
auth_user_user_permissions
They can be accessed in Python with something like:
可以使用以下内容在Python中访问它们:
>>> from django.contrib.auth.models import User, Group
>>> Group.objects.first().permissions.all()
Relevant documentation: Django docs on contrib.auth
相关文档:关于contrib.auth的Django文档
#1
0
The relevant tables for the Auth Django contrib app, which contains users and groups and their respective permissions are named as follows in the db:
Auth Django contrib应用程序的相关表(包含用户和组及其各自的权限)在db中命名如下:
auth_group
auth_group_permissions
auth_permission
auth_user
auth_user_groups
auth_user_user_permissions
They can be accessed in Python with something like:
可以使用以下内容在Python中访问它们:
>>> from django.contrib.auth.models import User, Group
>>> Group.objects.first().permissions.all()
Relevant documentation: Django docs on contrib.auth
相关文档:关于contrib.auth的Django文档