mirror of https://github.com/jumpserver/jumpserver
[Update] 修改用户组详情显示授权资产的bug
parent
fc2a44621b
commit
0bc86543b5
|
@ -106,21 +106,19 @@ class AssetPermissionUtil:
|
||||||
return assets
|
return assets
|
||||||
|
|
||||||
@classmethod
|
@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)}}
|
:return: {node: {asset: set(su1, su2)}}
|
||||||
"""
|
"""
|
||||||
nodes = defaultdict(dict)
|
_assets = cls.get_user_group_assets(group)
|
||||||
_assets = cls.get_user_group_assets(user)
|
tree = Tree()
|
||||||
for asset, _system_users in _assets.items():
|
for asset, _system_users in _assets.items():
|
||||||
_nodes = asset.get_nodes()
|
_nodes = asset.get_nodes()
|
||||||
|
tree.add_nodes(_nodes)
|
||||||
for node in _nodes:
|
for node in _nodes:
|
||||||
if asset in nodes[node]:
|
tree.nodes[node][asset].update(_system_users)
|
||||||
nodes[node][asset].update(_system_users)
|
return tree.nodes
|
||||||
else:
|
|
||||||
nodes[node][asset] = _system_users
|
|
||||||
return nodes
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_user_assets_direct(cls, user):
|
def get_user_assets_direct(cls, user):
|
||||||
|
|
|
@ -64,10 +64,11 @@
|
||||||
var zTree;
|
var zTree;
|
||||||
var inited = false;
|
var inited = false;
|
||||||
var url;
|
var url;
|
||||||
|
var asset_table;
|
||||||
|
|
||||||
function initTable() {
|
function initTable() {
|
||||||
if (inited){
|
if (inited){
|
||||||
return
|
return asset_table
|
||||||
} else {
|
} else {
|
||||||
inited = true;
|
inited = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue