diff --git a/apps/rbac/migrations/0012_alter_role_options.py b/apps/rbac/migrations/0012_alter_role_options.py index ba98b699e..6c7ce1525 100644 --- a/apps/rbac/migrations/0012_alter_role_options.py +++ b/apps/rbac/migrations/0012_alter_role_options.py @@ -12,6 +12,6 @@ class Migration(migrations.Migration): operations = [ migrations.AlterModelOptions( name='role', - options={'ordering': ('scope', 'name'), 'verbose_name': 'Role'}, + options={'ordering': ('-builtin', 'scope', 'name'), 'verbose_name': 'Role'}, ), ] diff --git a/apps/rbac/models/role.py b/apps/rbac/models/role.py index e5a18b5e6..796b1ab63 100644 --- a/apps/rbac/models/role.py +++ b/apps/rbac/models/role.py @@ -43,7 +43,7 @@ class Role(JMSBaseModel): class Meta: unique_together = [('name', 'scope')] - ordering = ('scope', 'name') + ordering = ('-builtin', 'scope', 'name') verbose_name = _('Role') def __str__(self):