fix: validate app perm error

pull/7750/head
ibuler 3 years ago committed by 老广
parent 31d219524b
commit 0afff45bae

@ -10,7 +10,7 @@ from rest_framework.generics import (
ListAPIView, get_object_or_404 ListAPIView, get_object_or_404
) )
from orgs.utils import tmp_to_root_org from orgs.utils import tmp_to_root_org, get_current_org
from applications.models import Application from applications.models import Application
from perms.utils.application.permission import ( from perms.utils.application.permission import (
get_application_system_user_ids, get_application_system_user_ids,
@ -56,7 +56,7 @@ class MyGrantedApplicationSystemUsersApi(RoleUserMixin, BaseGrantedApplicationSy
@method_decorator(tmp_to_root_org(), name='get') @method_decorator(tmp_to_root_org(), name='get')
class ValidateUserApplicationPermissionApi(APIView): class ValidateUserApplicationPermissionApi(APIView):
rbac_perms = { rbac_perms = {
'GET': 'ops.view_applicationpermission' 'GET': 'perms.view_applicationpermission'
} }
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):

@ -283,5 +283,7 @@ class ServiceAccountSerializer(serializers.ModelSerializer):
return name return name
def create(self, validated_data): def create(self, validated_data):
user, ak = User.create_service_account(validated_data['name'], validated_data['comment']) name = validated_data['name']
comment = validated_data.get('comment', '')
user, ak = User.create_service_account(name, comment)
return user return user

Loading…
Cancel
Save