def _validate_study(self, study):
        study_dao = StudyDAO()
        study_obj = study_dao.get(study_id=study)
        limit = study_obj.max_limit

        user_dao = UserDAO()
        total_partipants = user_dao.count_users_in_study(study)  + 1 #Added the future participant
        if (total_partipants > limit):
            raise AuthorizationServiceException("The study '%s' has reached the limit of allowed participants."%study)