mirror of https://github.com/jumpserver/jumpserver
fix(perms): 未激活资产不能使用
parent
f3d052554d
commit
373c6c77e0
|
@ -60,6 +60,7 @@ class SerializeToTreeNodeMixin:
|
||||||
'isParent': False,
|
'isParent': False,
|
||||||
'open': False,
|
'open': False,
|
||||||
'iconSkin': self.get_platform(asset),
|
'iconSkin': self.get_platform(asset),
|
||||||
|
'chkDisabled': not asset.is_active,
|
||||||
'meta': {
|
'meta': {
|
||||||
'type': 'asset',
|
'type': 'asset',
|
||||||
'asset': {
|
'asset': {
|
||||||
|
|
|
@ -75,7 +75,7 @@ class AssetGrantedSerializer(serializers.ModelSerializer):
|
||||||
model = Asset
|
model = Asset
|
||||||
only_fields = [
|
only_fields = [
|
||||||
"id", "hostname", "ip", "protocols", "os", 'domain',
|
"id", "hostname", "ip", "protocols", "os", 'domain',
|
||||||
"platform", "comment", "org_id",
|
"platform", "comment", "org_id", "is_active"
|
||||||
]
|
]
|
||||||
fields = only_fields + ['org_name']
|
fields = only_fields + ['org_name']
|
||||||
read_only_fields = fields
|
read_only_fields = fields
|
||||||
|
|
Loading…
Reference in New Issue