mirror of https://github.com/jumpserver/jumpserver
remove rbac redundant perms
parent
dbad0851e3
commit
7094df3527
|
@ -52,6 +52,8 @@ exclude_permissions = (
|
|||
('assets', 'verifyaccountautomation', '*', '*'),
|
||||
('assets', 'changesecretrecord', 'add,delete,change', 'changesecretrecord'),
|
||||
('assets', 'automationexecution', '*', 'automationexecution'),
|
||||
('assets', 'commandfilter', '*', '*'),
|
||||
('assets', 'commandfilterrule', '*', '*'),
|
||||
# TODO 暂时去掉历史账号的权限
|
||||
('assets', 'account', '*', 'assethistoryaccount'),
|
||||
('assets', 'account', '*', 'assethistoryaccountsecret'),
|
||||
|
|
|
@ -7,12 +7,21 @@ 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()
|
||||
|
||||
model.objects.filter(app_label='assets', model__in=[
|
||||
'authbook', 'historicalauthbook'
|
||||
]).delete()
|
||||
|
||||
model.objects.filter(app_label='perms', model__in=[
|
||||
'applicationpermission', 'permedapplication', 'commandfilterrule', 'historicalauthbook'
|
||||
]).delete()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
|
|
Loading…
Reference in New Issue