src/org/ohmage/service/UserClassServices.java
public void userBelongsToClasses(
			final String username,
			final Collection<String> classIds)
			throws ServiceException {

		try {
			for(String classId : classIds) {
				if(! userClassQueries.userBelongsToClass(classId, username)) {
					throw new ServiceException(
							ErrorCode.CLASS_INSUFFICIENT_PERMISSIONS,
							"The user does not belong to the class: " + 
								classId);
				}
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Verifies that the user belongs to all of the classes in the list.
	 * 
	 * @param username The user's username.
	 * 
	 * @param classIds The collection of class IDs.
	 * 
	 * @throws ServiceException Thrown if there is an error or if the user does
	 * 							not belong to the class.
	 */
Verifies that the user belongs to all of the classes in the list.

@param username The user's username.

@param classIds The collection of class IDs.

@throws ServiceException Thrown if there is an error or if the user does
not belong to the class.
Verifies that the user belongs to all of the classes in the list . @param username The user ' s username . @param classIds The collection of class IDs . @throws ServiceException Thrown if there is an error or if the user does not belong to the class .
public void userBelongsToClasses(
			final String username,
			final Collection<String> classIds)
			throws ServiceException {
		try {
			for(String classId : classIds) {
				if(! userClassQueries.userBelongsToClass(classId, username)) {
					throw new ServiceException(
							ErrorCode.CLASS_INSUFFICIENT_PERMISSIONS,
							"The user does not belong to the class: " + 
								classId);
				}
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void userBelongsToClasses ( final String username , final Collection < String > classIds ) throws ServiceException { try { for ( String classId : classIds ) { if ( ! userClassQueries . userBelongsToClass ( classId , username ) ) { throw new ServiceException ( ErrorCode . CLASS_INSUFFICIENT_PERMISSIONS , "The user does not belong to the class: " + classId ) ; } } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Verifies that the user belongs to all of the classes in the list.
Verifies that the user belongs to all of the classes in the list .