refactor: streamline auth_resource method for improved readability and maintainability

This commit is contained in:
CaptainB 2025-07-05 18:06:00 +08:00
parent e7a30903ba
commit 13596ed7e8

View File

@ -104,8 +104,6 @@ class UserResourcePermissionSerializer(serializers.Serializer):
def auth_resource(self, resource_id: str): def auth_resource(self, resource_id: str):
self.is_valid(raise_exception=True) self.is_valid(raise_exception=True)
workspace_manage = is_workspace_manage(self.data.get('user_id'), self.data.get('workspace_id'))
if not workspace_manage:
auth_target_type = self.data.get('auth_target_type') auth_target_type = self.data.get('auth_target_type')
workspace_id = self.data.get('workspace_id') workspace_id = self.data.get('workspace_id')
user_id = self.data.get('user_id') user_id = self.data.get('user_id')