mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-07 10:20:57 +00:00
refactor: 重构用户授权资产查询工具(重构中..) (#9225)
* refactor: 重构用户授权资产查询工具(重构中..) * perf: 修改 get_perm_nodes_assets 名称 * refactor: 优化用户授权节点查询工具; 删除UnionQuerySet工具 Co-authored-by: Bai <baijiangjie@gmail.com>
This commit is contained in:
@@ -9,7 +9,7 @@ from orgs.mixins.api import OrgBulkModelViewSet
|
||||
from orgs.utils import current_org
|
||||
from perms import serializers
|
||||
from perms import models
|
||||
from perms.utils.user_permission import UserGrantedAssetsQueryUtils
|
||||
from perms.utils import AssetPermissionPermAssetUtil
|
||||
from assets.serializers import AccountSerializer
|
||||
|
||||
__all__ = [
|
||||
@@ -95,8 +95,7 @@ class AssetPermissionAllAssetListApi(generics.ListAPIView):
|
||||
|
||||
def get_queryset(self):
|
||||
pk = self.kwargs.get("pk")
|
||||
query_utils = UserGrantedAssetsQueryUtils(None, asset_perm_ids=[pk])
|
||||
assets = query_utils.get_all_granted_assets()
|
||||
assets = AssetPermissionPermAssetUtil(perm_ids=[pk]).get_all_assets()
|
||||
return assets
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user