mirror of https://github.com/jumpserver/jumpserver
[Bugfix] 修复org下普通用户打开web终端看不到已被授权的资产和节点bug
parent
a48fb9de8d
commit
45a354f848
|
@ -14,6 +14,8 @@ from .models import AssetPermission
|
||||||
from .hands import AssetGrantedSerializer, User, UserGroup, Asset, Node, \
|
from .hands import AssetGrantedSerializer, User, UserGroup, Asset, Node, \
|
||||||
NodeGrantedSerializer, SystemUser, NodeSerializer
|
NodeGrantedSerializer, SystemUser, NodeSerializer
|
||||||
from . import serializers
|
from . import serializers
|
||||||
|
from orgs.utils import set_current_org
|
||||||
|
from orgs.models import Organization
|
||||||
|
|
||||||
|
|
||||||
class AssetPermissionViewSet(viewsets.ModelViewSet):
|
class AssetPermissionViewSet(viewsets.ModelViewSet):
|
||||||
|
@ -128,6 +130,7 @@ class UserGrantedNodesWithAssetsApi(ListAPIView):
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
def get_permissions(self):
|
def get_permissions(self):
|
||||||
|
set_current_org(Organization.root())
|
||||||
if self.kwargs.get('pk') is None:
|
if self.kwargs.get('pk') is None:
|
||||||
self.permission_classes = (IsValidUser,)
|
self.permission_classes = (IsValidUser,)
|
||||||
return super().get_permissions()
|
return super().get_permissions()
|
||||||
|
|
Loading…
Reference in New Issue