src/org/ohmage/service/UserCampaignServices.java
public void verifyUserCanReadClassesAssociatedWithCampaign(
			final String username, final String campaignId) 
			throws ServiceException {
		
		try {
			List<Campaign.Role> roles = userCampaignQueries.getUserCampaignRoles(username, campaignId);
			
			if(roles.contains(Campaign.Role.SUPERVISOR) || 
					roles.contains(Campaign.Role.AUTHOR)) {
				return;
			}
			
			throw new ServiceException(
					ErrorCode.CAMPAIGN_INSUFFICIENT_PERMISSIONS, 
					"The user doesn't have sufficient permissions to read the users and their roles for a campaign: " + 
						campaignId);
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Verifies that a user is allowed to read the list of classes associated 
	 * with a campaign.
	 * 
	 * @param username The username of the user whose permissions are being
	 * 				   checked.
	 * 
	 * @param campaignId The unique identifier for the campaign.
	 * 
	 * @throws ServiceException Thrown if the user doesn't have sufficient
	 * 							permissions to read the list of classes for a
	 * 							campaign.
	 */
Verifies that a user is allowed to read the list of classes associated
with a campaign.

@param username The username of the user whose permissions are being
checked.

@param campaignId The unique identifier for the campaign.

@throws ServiceException Thrown if the user doesn't have sufficient
permissions to read the list of classes for a
campaign.
Verifies that a user is allowed to read the list of classes associated with a campaign . @param username The username of the user whose permissions are being checked . @param campaignId The unique identifier for the campaign . @throws ServiceException Thrown if the user doesn ' t have sufficient permissions to read the list of classes for a campaign .
public void verifyUserCanReadClassesAssociatedWithCampaign(
			final String username, final String campaignId) 
			throws ServiceException {
		try {
			List<Campaign.Role> roles = userCampaignQueries.getUserCampaignRoles(username, campaignId);
			if(roles.contains(Campaign.Role.SUPERVISOR) || 
					roles.contains(Campaign.Role.AUTHOR)) {
				return;
			}
			throw new ServiceException(
					ErrorCode.CAMPAIGN_INSUFFICIENT_PERMISSIONS, 
					"The user doesn't have sufficient permissions to read the users and their roles for a campaign: " + 
						campaignId);
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void verifyUserCanReadClassesAssociatedWithCampaign ( final String username , final String campaignId ) throws ServiceException { try { List < Campaign . Role > roles = userCampaignQueries . getUserCampaignRoles ( username , campaignId ) ; if ( roles . contains ( Campaign . Role . SUPERVISOR ) || roles . contains ( Campaign . Role . AUTHOR ) ) { return ; } throw new ServiceException ( ErrorCode . CAMPAIGN_INSUFFICIENT_PERMISSIONS , "The user doesn't have sufficient permissions to read the users and their roles for a campaign: " + campaignId ) ; } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Verifies that a user is allowed to read the list of classes associated
 with a campaign.
Verifies that a user is allowed to read the list of classes associated with a campaign .