jumpserver/apps/rbac/migrations/0011_remove_redundant_permi...

25 lines
826 B
Python

# Generated by Django 3.2.16 on 2022-12-27 02:41
from django.db import migrations
def migrate_remove_redundant_permission(apps, *args):
model = apps.get_model('rbac', 'ContentType')
model.objects.filter(app_label='applications').delete()
model.objects.filter(app_label='ops', model='task').delete()
model.objects.filter(app_label='xpack', model__in=[
'applicationchangeauthplan', 'applicationchangeauthplanexecution',
'applicationchangeauthplantask', 'changeauthplan', 'changeauthplanexecution',
'changeauthplantask', 'gatherusertask', 'gatherusertaskexecution'
]).delete()
class Migration(migrations.Migration):
dependencies = [
('rbac', '0010_auto_20221220_1956'),
]
operations = [
migrations.RunPython(migrate_remove_redundant_permission)
]