src/org/ohmage/service/UserCampaignServices.java
public void campaignExistsAndUserBelongs(final String campaignId, 
			final String username) throws ServiceException {
		
		CampaignServices.instance().checkCampaignExistence(campaignId, true);
		
		try {
			if(! userCampaignQueries.userBelongsToCampaign(username, campaignId)) {
				throw new ServiceException(
						ErrorCode.CAMPAIGN_INSUFFICIENT_PERMISSIONS, 
						"The user does not belong to the campaign: " + 
							campaignId);
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Ensures that a campaign exists and that a user belongs to the campaign
	 * in some capacity.
	 * 
	 * @param campaignId The campaign ID for the campaign in question.
	 * 
	 * @param username The username of the user that must belong to the 
	 * 				   campaign.
	 * 
	 * @throws ServiceException Thrown if the campaign doesn't exist, the user
	 * 							doesn't belong to the campaign, or if there is
	 * 							an error.
	 */
Ensures that a campaign exists and that a user belongs to the campaign
in some capacity.

@param campaignId The campaign ID for the campaign in question.

@param username The username of the user that must belong to the
campaign.

@throws ServiceException Thrown if the campaign doesn't exist, the user
doesn't belong to the campaign, or if there is
an error.
Ensures that a campaign exists and that a user belongs to the campaign in some capacity . @param campaignId The campaign ID for the campaign in question . @param username The username of the user that must belong to the campaign . @throws ServiceException Thrown if the campaign doesn ' t exist the user doesn ' t belong to the campaign or if there is an error .
public void campaignExistsAndUserBelongs(final String campaignId, 
			final String username) throws ServiceException {
		CampaignServices.instance().checkCampaignExistence(campaignId, true);
		try {
			if(! userCampaignQueries.userBelongsToCampaign(username, campaignId)) {
				throw new ServiceException(
						ErrorCode.CAMPAIGN_INSUFFICIENT_PERMISSIONS, 
						"The user does not belong to the campaign: " + 
							campaignId);
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void campaignExistsAndUserBelongs ( final String campaignId , final String username ) throws ServiceException { CampaignServices . instance ( ) . checkCampaignExistence ( campaignId , true ) ; try { if ( ! userCampaignQueries . userBelongsToCampaign ( username , campaignId ) ) { throw new ServiceException ( ErrorCode . CAMPAIGN_INSUFFICIENT_PERMISSIONS , "The user does not belong to the campaign: " + campaignId ) ; } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Ensures that a campaign exists and that a user belongs to the campaign
 in some capacity.
Ensures that a campaign exists and that a user belongs to the campaign in some capacity .