mirror of https://github.com/jumpserver/jumpserver
Merge pull request #6555 from jumpserver/pr@dev@user_collection_node_fix
fix: 用户管理-用户-授权的资产-收藏夹下拉菜单报404bug修复pull/6563/head
commit
c1e6bc5d60
|
@ -203,7 +203,8 @@ class UserGrantedTreeRefreshController:
|
|||
logger.info(f'Rebuild user tree: user={self.user} org={current_org}')
|
||||
utils = UserGrantedTreeBuildUtils(user)
|
||||
utils.rebuild_user_granted_tree()
|
||||
logger.info(f'Rebuild user tree ok: cost={time.time() - t_start} user={self.user} org={current_org}')
|
||||
logger.info(
|
||||
f'Rebuild user tree ok: cost={time.time() - t_start} user={self.user} org={current_org}')
|
||||
|
||||
|
||||
class UserGrantedUtilsBase:
|
||||
|
@ -547,14 +548,16 @@ class UserGrantedNodesQueryUtils(UserGrantedUtilsBase):
|
|||
if not key:
|
||||
return self.get_top_level_nodes()
|
||||
|
||||
nodes = PermNode.objects.none()
|
||||
if key == PermNode.FAVORITE_NODE_KEY:
|
||||
return nodes
|
||||
|
||||
node = PermNode.objects.get(key=key)
|
||||
granted_status = node.get_granted_status(self.user)
|
||||
if granted_status == NodeFrom.granted:
|
||||
nodes = PermNode.objects.filter(parent_key=key)
|
||||
elif granted_status in (NodeFrom.asset, NodeFrom.child):
|
||||
nodes = self.get_indirect_granted_node_children(key)
|
||||
else:
|
||||
nodes = PermNode.objects.none()
|
||||
nodes = self.sort(nodes)
|
||||
return nodes
|
||||
|
||||
|
|
Loading…
Reference in New Issue