Skip to content

Commit

Permalink
Merge pull request #193 from coderbydesign/remove-default-roles
Browse files Browse the repository at this point in the history
Add data migration to remove default seeded roles
  • Loading branch information
coderbydesign authored Feb 3, 2020
2 parents c1fb096 + 1cefbb8 commit debb5b0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions rbac/management/migrations/0013_auto_20200128_2030.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 2.2.4 on 2020-01-28 20:30

from django.db import migrations


def remove_unnecessary_platform_default_role(apps, schema_editor):
role_names_to_remove = [
'Ansible Automation Access',
'Ansible Hub Access',
'Catalog Access',
'Remediations Access',
'Sources Access',
'Subscriptions Access',
]

Role = apps.get_model('management', 'Role')
Role.objects.filter(system=True, name__in=role_names_to_remove).delete()

class Migration(migrations.Migration):

dependencies = [
('management', '0012_remove_RonR_resources'),
]

operations = [
migrations.RunPython(remove_unnecessary_platform_default_role),
]

0 comments on commit debb5b0

Please sign in to comment.