mirror of https://github.com/jumpserver/jumpserver
Merge pull request #10727 from jumpserver/pr@dev@perf_acl_ordering
perf: 优化 acl 默认排序pull/10729/head
commit
b19d9c8754
|
@ -38,7 +38,7 @@ class Migration(migrations.Migration):
|
||||||
to=settings.AUTH_USER_MODEL, verbose_name='User')),
|
to=settings.AUTH_USER_MODEL, verbose_name='User')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ('priority', 'name'),
|
'ordering': ('priority', '-is_active', 'name'),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
|
@ -68,7 +68,7 @@ class Migration(migrations.Migration):
|
||||||
verbose_name='Reviewers')),
|
verbose_name='Reviewers')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ('priority', 'name'),
|
'ordering': ('priority', '-is_active', 'name'),
|
||||||
'unique_together': {('name', 'org_id')},
|
'unique_together': {('name', 'org_id')},
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
@ -89,10 +89,10 @@ class Migration(migrations.Migration):
|
||||||
),
|
),
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='loginacl',
|
name='loginacl',
|
||||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Login acl'},
|
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Login acl'},
|
||||||
),
|
),
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='loginassetacl',
|
name='loginassetacl',
|
||||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Login asset acl'},
|
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Login asset acl'},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -11,10 +11,10 @@ class Migration(migrations.Migration):
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='loginacl',
|
name='loginacl',
|
||||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Login acl'},
|
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Login acl'},
|
||||||
),
|
),
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='loginassetacl',
|
name='loginassetacl',
|
||||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Login asset acl'},
|
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Login asset acl'},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -63,7 +63,7 @@ class Migration(migrations.Migration):
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name': 'Command acl',
|
'verbose_name': 'Command acl',
|
||||||
'ordering': ('priority', 'name'),
|
'ordering': ('priority', '-is_active', 'name'),
|
||||||
'unique_together': {('name', 'org_id')},
|
'unique_together': {('name', 'org_id')},
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
@ -20,14 +20,14 @@ class Migration(migrations.Migration):
|
||||||
),
|
),
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='commandfilteracl',
|
name='commandfilteracl',
|
||||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Command acl'},
|
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Command acl'},
|
||||||
),
|
),
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='loginacl',
|
name='loginacl',
|
||||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Login acl'},
|
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Login acl'},
|
||||||
),
|
),
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='loginassetacl',
|
name='loginassetacl',
|
||||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Login asset acl'},
|
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Login asset acl'},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Migration(migrations.Migration):
|
||||||
models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL, verbose_name='Reviewers')),
|
models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL, verbose_name='Reviewers')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ('priority', 'name'),
|
'ordering': ('priority', '-is_active', 'name'),
|
||||||
'abstract': False,
|
'abstract': False,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('acls', '0016_auto_20230606_1857'),
|
('acls', '0016_auto_20230606_1857'),
|
||||||
]
|
]
|
||||||
|
@ -12,6 +11,6 @@ class Migration(migrations.Migration):
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='connectmethodacl',
|
name='connectmethodacl',
|
||||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Connect method acl'},
|
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Connect method acl'},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -51,7 +51,7 @@ class BaseACL(JMSBaseModel):
|
||||||
objects = BaseACLQuerySet.as_manager()
|
objects = BaseACLQuerySet.as_manager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('priority', 'name')
|
ordering = ('priority', '-is_active', 'name')
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
def is_action(self, action):
|
def is_action(self, action):
|
||||||
|
|
Loading…
Reference in New Issue