Commit 30c4fc95 authored by ibuler's avatar ibuler

App user get user perms

parent 91601cce
...@@ -5,7 +5,7 @@ from django.shortcuts import get_object_or_404 ...@@ -5,7 +5,7 @@ from django.shortcuts import get_object_or_404
from rest_framework.views import APIView, Response from rest_framework.views import APIView, Response
from rest_framework.generics import ListAPIView, get_object_or_404 from rest_framework.generics import ListAPIView, get_object_or_404
from rest_framework import viewsets 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 common.utils import get_object_or_none
from .utils import get_user_granted_assets, get_user_granted_asset_groups, \ from .utils import get_user_granted_assets, get_user_granted_asset_groups, \
get_user_asset_permissions, get_user_group_asset_permissions, \ get_user_asset_permissions, get_user_group_asset_permissions, \
...@@ -118,7 +118,7 @@ class RevokeUserGroupAssetPermission(APIView): ...@@ -118,7 +118,7 @@ class RevokeUserGroupAssetPermission(APIView):
class UserGrantedAssetsApi(ListAPIView): class UserGrantedAssetsApi(ListAPIView):
permission_classes = (IsSuperUser,) permission_classes = (IsSuperUserOrAppUser,)
serializer_class = AssetGrantedSerializer serializer_class = AssetGrantedSerializer
def get_queryset(self): def get_queryset(self):
...@@ -134,7 +134,7 @@ class UserGrantedAssetsApi(ListAPIView): ...@@ -134,7 +134,7 @@ class UserGrantedAssetsApi(ListAPIView):
class UserGrantedAssetGroupsApi(ListAPIView): class UserGrantedAssetGroupsApi(ListAPIView):
permission_classes = (IsSuperUser,) permission_classes = (IsSuperUserOrAppUser,)
serializer_class = AssetGroupSerializer serializer_class = AssetGroupSerializer
def get_queryset(self): def get_queryset(self):
...@@ -166,6 +166,7 @@ class MyGrantedAssetsApi(ListAPIView): ...@@ -166,6 +166,7 @@ class MyGrantedAssetsApi(ListAPIView):
return queryset return queryset
class MyGrantedAssetsGroupsApi(APIView): class MyGrantedAssetsGroupsApi(APIView):
"""授权给用户的资产组列表, 非直接通过授权规则授权的资产组列表, 而是授权资产的所有 """授权给用户的资产组列表, 非直接通过授权规则授权的资产组列表, 而是授权资产的所有
资产组之和""" 资产组之和"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment