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
f19f28cf
Commit
f19f28cf
authored
Jul 16, 2019
by
BaiJiangJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 获取用户授权资产时只返回资产协议支持的系统用户
parent
4d1da1d2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
mixin.py
apps/perms/api/mixin.py
+2
-0
user_permission.py
apps/perms/api/user_permission.py
+2
-0
No files found.
apps/perms/api/mixin.py
View file @
f19f28cf
...
@@ -174,6 +174,8 @@ class GrantAssetsMixin(LabelFilterMixin):
...
@@ -174,6 +174,8 @@ class GrantAssetsMixin(LabelFilterMixin):
system_user
=
system_users_map
.
get
(
sid
)
system_user
=
system_users_map
.
get
(
sid
)
if
not
system_user
:
if
not
system_user
:
continue
continue
if
not
asset
.
has_protocol
(
system_user
.
protocol
):
continue
system_user
.
actions
=
action
system_user
.
actions
=
action
system_users_granted
.
append
(
system_user
)
system_users_granted
.
append
(
system_user
)
asset
.
system_users_granted
=
system_users_granted
asset
.
system_users_granted
=
system_users_granted
...
...
apps/perms/api/user_permission.py
View file @
f19f28cf
...
@@ -256,6 +256,8 @@ class UserGrantedNodesWithAssetsApi(UserPermissionCacheMixin, NodesWithUngroupMi
...
@@ -256,6 +256,8 @@ class UserGrantedNodesWithAssetsApi(UserPermissionCacheMixin, NodesWithUngroupMi
system_user
=
_system_users_map
.
get
(
system_user_id
)
system_user
=
_system_users_map
.
get
(
system_user_id
)
if
not
system_user
:
if
not
system_user
:
continue
continue
if
not
asset
.
has_protocol
(
system_user
.
protocol
):
continue
system_user
.
actions
=
action
system_user
.
actions
=
action
system_user_granted
.
append
(
system_user
)
system_user_granted
.
append
(
system_user
)
asset
.
system_users_granted
=
system_user_granted
asset
.
system_users_granted
=
system_user_granted
...
...
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