mirror of https://github.com/jumpserver/jumpserver
App user get user perms
parent
91601cce9e
commit
30c4fc9514
|
@ -5,7 +5,7 @@ from django.shortcuts import get_object_or_404
|
|||
from rest_framework.views import APIView, Response
|
||||
from rest_framework.generics import ListAPIView, get_object_or_404
|
||||
from rest_framework import viewsets
|
||||
from users.permissions import IsValidUser, IsSuperUser, IsAppUser
|
||||
from users.permissions import IsValidUser, IsSuperUser, IsAppUser, IsSuperUserOrAppUser
|
||||
from common.utils import get_object_or_none
|
||||
from .utils import get_user_granted_assets, get_user_granted_asset_groups, \
|
||||
get_user_asset_permissions, get_user_group_asset_permissions, \
|
||||
|
@ -118,7 +118,7 @@ class RevokeUserGroupAssetPermission(APIView):
|
|||
|
||||
|
||||
class UserGrantedAssetsApi(ListAPIView):
|
||||
permission_classes = (IsSuperUser,)
|
||||
permission_classes = (IsSuperUserOrAppUser,)
|
||||
serializer_class = AssetGrantedSerializer
|
||||
|
||||
def get_queryset(self):
|
||||
|
@ -134,7 +134,7 @@ class UserGrantedAssetsApi(ListAPIView):
|
|||
|
||||
|
||||
class UserGrantedAssetGroupsApi(ListAPIView):
|
||||
permission_classes = (IsSuperUser,)
|
||||
permission_classes = (IsSuperUserOrAppUser,)
|
||||
serializer_class = AssetGroupSerializer
|
||||
|
||||
def get_queryset(self):
|
||||
|
@ -166,6 +166,7 @@ class MyGrantedAssetsApi(ListAPIView):
|
|||
return queryset
|
||||
|
||||
|
||||
|
||||
class MyGrantedAssetsGroupsApi(APIView):
|
||||
"""授权给用户的资产组列表, 非直接通过授权规则授权的资产组列表, 而是授权资产的所有
|
||||
资产组之和"""
|
||||
|
|
Loading…
Reference in New Issue