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
70664d43
Commit
70664d43
authored
Oct 17, 2019
by
jym503558564
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改小问题
parent
ee97144a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
asset_permission.py
apps/perms/api/asset_permission.py
+7
-7
No files found.
apps/perms/api/asset_permission.py
View file @
70664d43
...
...
@@ -68,18 +68,18 @@ class AssetPermissionViewSet(viewsets.ModelViewSet):
node_id
=
self
.
request
.
query_params
.
get
(
'node_id'
)
node_name
=
self
.
request
.
query_params
.
get
(
'node'
)
if
node_id
:
nodes
=
Node
.
objects
.
filter
(
pk
=
node_id
)
_
nodes
=
Node
.
objects
.
filter
(
pk
=
node_id
)
elif
node_name
:
nodes
=
Node
.
objects
.
filter
(
value
=
node_name
)
_
nodes
=
Node
.
objects
.
filter
(
value
=
node_name
)
else
:
return
queryset
if
not
nodes
:
if
not
_
nodes
:
return
queryset
.
none
()
related_nodes
=
[]
for
node
in
nodes
:
[
related_nodes
.
append
(
item
)
for
item
in
node
.
get_ancestors
(
with_self
=
True
)]
queryset
=
queryset
.
filter
(
nodes__in
=
related_
nodes
)
nodes
=
set
()
for
node
in
_
nodes
:
nodes
|=
set
(
node
.
get_ancestors
(
with_self
=
True
))
queryset
=
queryset
.
filter
(
nodes__in
=
nodes
)
return
queryset
def
filter_asset
(
self
,
queryset
):
...
...
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