mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-04 17:01:09 +00:00
perf: perm account 返回 alias
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
import abc
|
||||
|
||||
from rest_framework.generics import ListAPIView
|
||||
|
||||
from assets.models import Node
|
||||
from common.utils import get_logger, lazyproperty
|
||||
from perms import serializers
|
||||
from perms.utils.user_permission import UserGrantedNodesQueryUtils
|
||||
from common.utils import get_logger, lazyproperty
|
||||
|
||||
from .mixin import SelfOrPKUserMixin
|
||||
|
||||
logger = get_logger(__name__)
|
||||
@@ -19,7 +19,7 @@ __all__ = [
|
||||
|
||||
|
||||
class BaseUserPermedNodesApi(SelfOrPKUserMixin, ListAPIView):
|
||||
serializer_class = serializers.NodeGrantedSerializer
|
||||
serializer_class = serializers.NodePermedSerializer
|
||||
|
||||
def get_queryset(self):
|
||||
if getattr(self, 'swagger_fake_view', False):
|
||||
@@ -37,12 +37,14 @@ class BaseUserPermedNodesApi(SelfOrPKUserMixin, ListAPIView):
|
||||
|
||||
class UserAllPermedNodesApi(BaseUserPermedNodesApi):
|
||||
""" 用户授权的节点 """
|
||||
|
||||
def get_nodes(self):
|
||||
return self.query_node_util.get_whole_tree_nodes()
|
||||
|
||||
|
||||
class UserPermedNodeChildrenApi(BaseUserPermedNodesApi):
|
||||
""" 用户授权的节点下的子节点 """
|
||||
|
||||
def get_nodes(self):
|
||||
key = self.request.query_params.get('key')
|
||||
nodes = self.query_node_util.get_node_children(key)
|
||||
|
Reference in New Issue
Block a user