[Answered ]-How I can list the group table with their respective group permissions and permissions?

2👍

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_group
  • auth_group_permissions
  • auth_permission
  • auth_user
  • auth_user_groups
  • auth_user_user_permissions

They can be accessed in Python with something like:

>>> from django.contrib.auth.models import User, Group
>>> Group.objects.first().permissions.all()

Relevant documentation: Django docs on contrib.auth

👤Wtower

Leave a comment