mirror of https://github.com/jumpserver/jumpserver
Merge branch 'v3' of github.com:jumpserver/jumpserver into v3
commit
21b1dd076a
|
@ -22,7 +22,7 @@ class Migration(migrations.Migration):
|
|||
migrations.AddField(
|
||||
model_name='loginassetacl',
|
||||
name='accounts',
|
||||
field=models.JSONField(default=dict, verbose_name='Account'),
|
||||
field=models.JSONField(verbose_name='Account'),
|
||||
),
|
||||
migrations.RunPython(migrate_system_users_to_accounts),
|
||||
migrations.RemoveField(
|
||||
|
|
|
@ -18,7 +18,7 @@ class LoginAssetACL(BaseACL, OrgModelMixin):
|
|||
|
||||
# 条件
|
||||
users = models.JSONField(verbose_name=_('User'))
|
||||
accounts = models.JSONField(verbose_name=_('Account'), default=dict)
|
||||
accounts = models.JSONField(verbose_name=_('Account'))
|
||||
assets = models.JSONField(verbose_name=_('Asset'))
|
||||
# 动作
|
||||
action = models.CharField(
|
||||
|
|
|
@ -28,30 +28,25 @@ class LoginAssetACLAssestsSerializer(serializers.Serializer):
|
|||
ip_group_help_text = _(
|
||||
"Format for comma-delimited string, with * indicating a match all. "
|
||||
"Such as: "
|
||||
"192.168.10.1, 192.168.1.0/24, 10.1.1.1-10.1.1.20, 2001:db8:2de::e13, 2001:db8:1a:1110::/64 "
|
||||
"(Domain name support)"
|
||||
"192.168.10.1, 192.168.1.0/24, 10.1.1.1-10.1.1.20, 2001:db8:2de::e13, 2001:db8:1a:1110::/64"
|
||||
" (Domain name support)"
|
||||
)
|
||||
|
||||
ip_group = serializers.ListField(
|
||||
default=["*"],
|
||||
child=serializers.CharField(max_length=1024),
|
||||
label=_("IP"),
|
||||
label=_("IP/Host"),
|
||||
help_text=ip_group_help_text,
|
||||
)
|
||||
hostname_group = serializers.ListField(
|
||||
default=["*"],
|
||||
child=serializers.CharField(max_length=128),
|
||||
label=_("Hostname"),
|
||||
label=_("Name"),
|
||||
help_text=common_help_text,
|
||||
)
|
||||
|
||||
|
||||
class LoginAssetACLAccountsSerializer(serializers.Serializer):
|
||||
protocol_group_help_text = _(
|
||||
"Format for comma-delimited string, with * indicating a match all. "
|
||||
"Protocol options: {}"
|
||||
)
|
||||
|
||||
name_group = serializers.ListField(
|
||||
default=["*"],
|
||||
child=serializers.CharField(max_length=128),
|
||||
|
@ -70,9 +65,7 @@ class LoginAssetACLSerializer(BulkOrgResourceModelSerializer):
|
|||
users = LoginAssetACLUsersSerializer()
|
||||
assets = LoginAssetACLAssestsSerializer()
|
||||
accounts = LoginAssetACLAccountsSerializer()
|
||||
reviewers_amount = serializers.IntegerField(
|
||||
read_only=True, source="reviewers.count"
|
||||
)
|
||||
reviewers_amount = serializers.IntegerField(read_only=True, source="reviewers.count")
|
||||
action = LabeledChoiceField(
|
||||
choices=models.LoginAssetACL.ActionChoices.choices, label=_("Action")
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue