mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-10 20:00:10 +00:00
remove rbac redundant perms
This commit is contained in:
@@ -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 = [
|
||||
|
Reference in New Issue
Block a user