Всё время забываю как оно там скручено, поэтому на память выкладываю сюда:

medical=# select id from django_content_type 
           where app_label='billing' and model='transfer';
id
-----
119

medical=# select * from auth_permission where content_type_id = 119;
id  |        name         | content_type_id |    codename
-----+---------------------+-----------------+-----------------
564 | Can add transfer    |             119 | add_transfer
565 | Can change transfer |             119 | change_transfer
566 | Can delete transfer |             119 | delete_transfer
567 | Can view transfer   |             119 | view_transfer

medical=# select * from beria_customuser_groups 
           where customuser_id = '72f8bf42-27c8-4289-a8cd-4faa733f18d9';
id  |            customuser_id             | group_id
-----+--------------------------------------+----------
131 | 72f8bf42-27c8-4289-a8cd-4faa733f18d9 |        7

medical=# select * from auth_group where id = 7;
id |       name
----+------------------
7 | Hospital Cashier

medical=# select * from auth_group_permissions where group_id = 7;
id  | group_id | permission_id
------+----------+---------------
1015 |        7 |           564

select ag.name, ap.codename
  from auth_group_permissions agp, auth_group ag, auth_permission ap,
       beria_customuser_groups bcg
 where agp.group_id = ag.id
   and agp.permission_id = ap.id
   and bcg.group_id = agp.group_id
   and bcg.customuser_id = '72f8bf42-27c8-4289-a8cd-4faa733f18d9';