The views for managing groups within the app are collected into a 'viewset' class, which acts as a single point of reference for all shared components of those views, such as forms. By subclassing the viewset, it is possible to override those components and customise the behaviour of the group management interface.
## Custom edit/create forms
This example shows how to customise forms on the 'edit group' and 'create group' views in the Wagtail admin.
Let's say you need to connect Active Directory groups with Django groups.
We create a model for Active Directory groups as follows:
Finally, we configure the `wagtail.users` application to use the custom viewset, by setting up a custom `AppConfig` class. Within your project folder (which will be the package containing the top-level settings and urls modules), create `apps.py` (if it does not exist already) and add:
## Customising the group editor permissions ordering
The order that object types appear in the group editor's "Object permissions" and "Other permissions" sections can be configured by registering that order in one or more `AppConfig` definitions. The order value is typically an integer between 0 and 999, although this is not enforced.
```python
from django.apps import AppConfig
class MyProjectAdminAppConfig(AppConfig):
name = "myproject_admin"
verbose_name = "My Project Admin"
def ready(self):
from wagtail.users.permission_order import register
register("gadgets.SprocketType", order=150)
register("gadgets.ChainType", order=151)
register("site_settings.Settings", order=160)
```
A model class can also be passed to `register()`.
Any object types that are not explicitly given an order will be sorted in alphabetical order by `app_label` and `model`, and listed after all of the object types _with_ a configured order.