Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
5f59c729
Unverified
Commit
5f59c729
authored
Jul 22, 2019
by
老广
Committed by
GitHub
Jul 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Perm for assets (#3003)
* [Update] 授权显示节点下所有的资产 * [Update] 修改返回资产的comment * [Update] 修改节点返回字段
parent
a8af4e88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
node.py
apps/assets/serializers/node.py
+3
-2
No files found.
apps/assets/serializers/node.py
View file @
5f59c729
...
@@ -14,13 +14,14 @@ __all__ = [
...
@@ -14,13 +14,14 @@ __all__ = [
class
NodeSerializer
(
BulkOrgResourceModelSerializer
):
class
NodeSerializer
(
BulkOrgResourceModelSerializer
):
assets_amount
=
serializers
.
IntegerField
(
read_only
=
True
)
assets_amount
=
serializers
.
IntegerField
(
read_only
=
True
)
name
=
serializers
.
ReadOnlyField
(
source
=
'value'
)
class
Meta
:
class
Meta
:
model
=
Node
model
=
Node
only_fields
=
[
'id'
,
'key'
,
'value'
,
'org_id'
]
only_fields
=
[
'id'
,
'key'
,
'value'
,
'org_id'
]
fields
=
only_fields
+
[
'assets_amount'
]
fields
=
only_fields
+
[
'
name'
,
'
assets_amount'
]
read_only_fields
=
[
read_only_fields
=
[
'key'
,
'assets_amount'
,
'org_id'
,
'key'
,
'
name'
,
'
assets_amount'
,
'org_id'
,
]
]
def
validate_value
(
self
,
data
):
def
validate_value
(
self
,
data
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment