src/org/ohmage/service/UserCampaignServices.java
public void verifyUserCanUploadSurveyResponses( 
			final String username, final String campaignId) 
			throws ServiceException {
		
		try {
			if(! userCampaignQueries.getUserCampaignRoles(username, campaignId).contains(Campaign.Role.PARTICIPANT)) {
				throw new ServiceException(
						ErrorCode.SURVEY_INSUFFICIENT_PERMISSIONS, 
						"The user is not a participant in the campaign and, therefore, cannot upload responses.");
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Verifies that the user is allowed to upload survey responses.
	 * 
	 * @param username The username of the user that is attempting to upload
	 * 				   this data.
	 * 
	 * @param campaignId The campaign's unique identifier.
	 * 
	 * @throws ServiceException Thrown if the user is not allowed to upload 
	 * 							survey responses or if there is an error.
	 */
Verifies that the user is allowed to upload survey responses.

@param username The username of the user that is attempting to upload
this data.

@param campaignId The campaign's unique identifier.

@throws ServiceException Thrown if the user is not allowed to upload
survey responses or if there is an error.
Verifies that the user is allowed to upload survey responses . @param username The username of the user that is attempting to upload this data . @param campaignId The campaign ' s unique identifier . @throws ServiceException Thrown if the user is not allowed to upload survey responses or if there is an error .
public void verifyUserCanUploadSurveyResponses( 
			final String username, final String campaignId) 
			throws ServiceException {
		try {
			if(! userCampaignQueries.getUserCampaignRoles(username, campaignId).contains(Campaign.Role.PARTICIPANT)) {
				throw new ServiceException(
						ErrorCode.SURVEY_INSUFFICIENT_PERMISSIONS, 
						"The user is not a participant in the campaign and, therefore, cannot upload responses.");
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void verifyUserCanUploadSurveyResponses ( final String username , final String campaignId ) throws ServiceException { try { if ( ! userCampaignQueries . getUserCampaignRoles ( username , campaignId ) . contains ( Campaign . Role . PARTICIPANT ) ) { throw new ServiceException ( ErrorCode . SURVEY_INSUFFICIENT_PERMISSIONS , "The user is not a participant in the campaign and, therefore, cannot upload responses." ) ; } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Verifies that the user is allowed to upload survey responses.
Verifies that the user is allowed to upload survey responses .