public async Task <(OperationErrorMessages, object)> InternalAPI_FileUploadUserAccess(InternalAPI_FileUploadUserAccessDTO fileUploadUserAccessDTO) { var userId = ObjectId.Parse(fileUploadUserAccessDTO.UserId); var roomId = ObjectId.Parse(fileUploadUserAccessDTO.RoomId); var testId = ObjectId.Parse(fileUploadUserAccessDTO.TestId); var room = await _roomRepository.GetRoomById(roomId); if (room == null) { return(OperationErrorMessages.RoomNotFound, null); } else if (room.UserId != userId) { return(OperationErrorMessages.RoomAccessError, null); } var test = await _testRepository.GetTestById(testId); if (test == null) { return(OperationErrorMessages.TestNotFound, null); } else if (test.UserId != userId) { return(OperationErrorMessages.TestAccessError, null); } return(OperationErrorMessages.NoError, null); }
public async Task <IActionResult> FileUploadAccess([FromBody] InternalAPI_FileUploadUserAccessDTO fileUploadUserAccessDTO) { var(errorCode, response) = await _validationService.InternalAPI_FileUploadUserAccess(fileUploadUserAccessDTO); return(this.ResultResponse(errorCode, response)); }