fix: The type of resource authorization is incorrect (#3524)

This commit is contained in:
shaohuzhang1 2025-07-09 11:03:19 +08:00 committed by GitHub
parent 4eda4a0d1b
commit 6411f32a3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -136,7 +136,7 @@ class UserResourcePermissionSerializer(serializers.Serializer):
workspace_id = self.data.get('workspace_id')
user_id = self.data.get('user_id')
wurp = QuerySet(WorkspaceUserResourcePermission).filter(auth_target_type=auth_target_type,
workspace_id=workspace_id).first()
workspace_id=workspace_id, user_id=user_id).first()
auth_type = wurp.auth_type if wurp else (
ResourceAuthType.RESOURCE_PERMISSION_GROUP if edition == 'CE' else ResourceAuthType.ROLE)
# 自动授权给创建者