mirror of https://github.com/jumpserver/jumpserver
perf: 优化 acl 默认排序
parent
c6e19a2989
commit
e92c82568d
|
@ -38,7 +38,7 @@ class Migration(migrations.Migration):
|
|||
to=settings.AUTH_USER_MODEL, verbose_name='User')),
|
||||
],
|
||||
options={
|
||||
'ordering': ('priority', 'name'),
|
||||
'ordering': ('priority', '-is_active', 'name'),
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
|
@ -68,7 +68,7 @@ class Migration(migrations.Migration):
|
|||
verbose_name='Reviewers')),
|
||||
],
|
||||
options={
|
||||
'ordering': ('priority', 'name'),
|
||||
'ordering': ('priority', '-is_active', 'name'),
|
||||
'unique_together': {('name', 'org_id')},
|
||||
},
|
||||
),
|
||||
|
|
|
@ -89,10 +89,10 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='loginacl',
|
||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Login acl'},
|
||||
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Login acl'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
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 = [
|
||||
migrations.AlterModelOptions(
|
||||
name='loginacl',
|
||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Login acl'},
|
||||
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Login acl'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
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={
|
||||
'verbose_name': 'Command acl',
|
||||
'ordering': ('priority', 'name'),
|
||||
'ordering': ('priority', '-is_active', 'name'),
|
||||
'unique_together': {('name', 'org_id')},
|
||||
},
|
||||
),
|
||||
|
|
|
@ -20,14 +20,14 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='commandfilteracl',
|
||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Command acl'},
|
||||
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Command acl'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='loginacl',
|
||||
options={'ordering': ('priority', 'name'), 'verbose_name': 'Login acl'},
|
||||
options={'ordering': ('priority', '-is_active', 'name'), 'verbose_name': 'Login acl'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
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')),
|
||||
],
|
||||
options={
|
||||
'ordering': ('priority', 'name'),
|
||||
'ordering': ('priority', '-is_active', 'name'),
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('acls', '0016_auto_20230606_1857'),
|
||||
]
|
||||
|
@ -12,6 +11,6 @@ class Migration(migrations.Migration):
|
|||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
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()
|
||||
|
||||
class Meta:
|
||||
ordering = ('priority', 'name')
|
||||
ordering = ('priority', '-is_active', 'name')
|
||||
abstract = True
|
||||
|
||||
def is_action(self, action):
|
||||
|
|
Loading…
Reference in New Issue