perf(perms): 修改授权授权应用API,添加category/type过滤字段

pull/4904/head
Bai 2020-10-30 11:50:37 +08:00 committed by Jiangjie.Bai
parent 15992c636a
commit ddc2d1106b
1 changed files with 2 additions and 9 deletions

View File

@ -22,7 +22,7 @@ __all__ = [
class AllGrantedApplicationsMixin(ListAPIView):
only_fields = serializers.ApplicationGrantedSerializer.Meta.only_fields
serializer_class = serializers.ApplicationGrantedSerializer
filter_fields = ['id', 'name', 'comment']
filter_fields = ['id', 'name', 'category', 'type', 'comment']
search_fields = ['name', 'comment']
user: None
@ -32,14 +32,7 @@ class AllGrantedApplicationsMixin(ListAPIView):
class UserAllGrantedApplicationsApi(ForAdminMixin, AllGrantedApplicationsMixin):
only_fields = serializers.ApplicationGrantedSerializer.Meta.only_fields
serializer_class = serializers.ApplicationGrantedSerializer
filter_fields = ['id', 'name', 'comment']
search_fields = ['name', 'comment']
def get_queryset(self):
queryset = get_user_granted_all_applications(self.user)
return queryset.only(*self.only_fields)
pass
class MyAllGrantedApplicationsApi(ForUserMixin, AllGrantedApplicationsMixin):