Skip to main content

Review group grants

Review group grants (dark theme)
Review group grants (light theme)

Drag the divider or use the arrow keys to compare themes.

Review group grants
Review group grants (dark theme)
Review group grants (light theme)

Drag the divider or use the arrow keys to compare themes.

  1. The group form organizes permissions by Django application.
  2. The training catalog grants separate model and transfer-history permissions.
Review group grants

Django Chassis 1.0.23 · training site with Russian UI

  1. The group form organizes permissions by Django application.
  2. The training catalog grants separate model and transfer-history permissions.

How to add it​

The users module registers Chassis GroupAdmin, which shows the grouped permission grid. After applying the catalog migrations, run this in the demo directory with ./run.sh shell to give the reader group the grants shown. Open the group under Administrators → Groups as an active staff superuser and expand the catalog app.

from django.contrib.auth.models import Group, Permission, User

permissions = Permission.objects.filter(
content_type__app_label='catalog_demo',
codename__in=['view_device', 'view_category', 'view_device_import', 'view_device_export']
)
group, _ = Group.objects.get_or_create(name='Читатели учебного каталога')
group.permissions.add(*permissions)
User.objects.get(username='demo-viewer').groups.add(group)