[Update] 修改用户组详情显示授权资产的bug

pull/1365/head
ibuler 7 years ago
parent fc2a44621b
commit 0bc86543b5

@ -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):

@ -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;
}

Loading…
Cancel
Save