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
0bc86543
Commit
0bc86543
authored
May 26, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改用户组详情显示授权资产的bug
parent
fc2a4462
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
utils.py
apps/perms/utils.py
+7
-9
user_group_granted_asset.html
apps/users/templates/users/user_group_granted_asset.html
+2
-1
No files found.
apps/perms/utils.py
View file @
0bc86543
...
...
@@ -106,21 +106,19 @@ class AssetPermissionUtil:
return
assets
@classmethod
def
get_user_group_nodes_with_assets
(
cls
,
user
):
def
get_user_group_nodes_with_assets
(
cls
,
group
):
"""
:param
user
:
:param
group
:
:return: {node: {asset: set(su1, su2)}}
"""
nodes
=
defaultdict
(
dict
)
_assets
=
cls
.
get_user_group_assets
(
user
)
_assets
=
cls
.
get_user_group_assets
(
group
)
tree
=
Tree
(
)
for
asset
,
_system_users
in
_assets
.
items
():
_nodes
=
asset
.
get_nodes
()
tree
.
add_nodes
(
_nodes
)
for
node
in
_nodes
:
if
asset
in
nodes
[
node
]:
nodes
[
node
][
asset
]
.
update
(
_system_users
)
else
:
nodes
[
node
][
asset
]
=
_system_users
return
nodes
tree
.
nodes
[
node
][
asset
]
.
update
(
_system_users
)
return
tree
.
nodes
@classmethod
def
get_user_assets_direct
(
cls
,
user
):
...
...
apps/users/templates/users/user_group_granted_asset.html
View file @
0bc86543
...
...
@@ -64,10 +64,11 @@
var
zTree
;
var
inited
=
false
;
var
url
;
var
asset_table
;
function
initTable
()
{
if
(
inited
){
return
return
asset_table
}
else
{
inited
=
true
;
}
...
...
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