mirror of https://github.com/jumpserver/jumpserver
parent
bdd885069f
commit
00450121bc
|
@ -10,7 +10,7 @@ __all__ = ['CommandFilterACLViewSet', 'CommandGroupViewSet']
|
||||||
|
|
||||||
class CommandGroupViewSet(OrgBulkModelViewSet):
|
class CommandGroupViewSet(OrgBulkModelViewSet):
|
||||||
model = models.CommandGroup
|
model = models.CommandGroup
|
||||||
filterset_fields = ('name',)
|
filterset_fields = ('name', 'command_filters')
|
||||||
search_fields = filterset_fields
|
search_fields = filterset_fields
|
||||||
serializer_class = serializers.CommandGroupSerializer
|
serializer_class = serializers.CommandGroupSerializer
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 4.1.10 on 2023-10-18 10:44
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('acls', '0017_alter_connectmethodacl_options'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='commandfilteracl',
|
||||||
|
name='command_groups',
|
||||||
|
field=models.ManyToManyField(related_name='command_filters', to='acls.commandgroup', verbose_name='Command group'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -93,7 +93,10 @@ class CommandGroup(JMSOrgBaseModel):
|
||||||
|
|
||||||
|
|
||||||
class CommandFilterACL(UserAssetAccountBaseACL):
|
class CommandFilterACL(UserAssetAccountBaseACL):
|
||||||
command_groups = models.ManyToManyField(CommandGroup, verbose_name=_('Command group'))
|
command_groups = models.ManyToManyField(
|
||||||
|
CommandGroup, verbose_name=_('Command group'),
|
||||||
|
related_name='command_filters'
|
||||||
|
)
|
||||||
|
|
||||||
class Meta(UserAssetAccountBaseACL.Meta):
|
class Meta(UserAssetAccountBaseACL.Meta):
|
||||||
abstract = False
|
abstract = False
|
||||||
|
|
Loading…
Reference in New Issue