src/org/ohmage/service/UserClassServices.java
public void userIsAdminOrPrivileged(final String classId, 
			final String username) throws ServiceException {
		
		try {
			if((! Clazz.Role.PRIVILEGED.equals(userClassQueries.getUserClassRole(classId, username))) &&
			   (! userQueries.userIsAdmin(username))) {
				throw new ServiceException(
						ErrorCode.CLASS_INSUFFICIENT_PERMISSIONS, 
						"The user is not privileged in the class.");
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Checks if the user is privileged in the class or an admin.
	 *  
	 * @param classId The class to check if the user is privileged.
	 * 
	 * @param username The user to check if they are privileged in the class.
	 * 
	 * @throws ServiceException Thrown if there is an error or if the user is
	 * 							not privileged in the class nor are they an 
	 * 							admin.
	 */
Checks if the user is privileged in the class or an admin.

@param classId The class to check if the user is privileged.

@param username The user to check if they are privileged in the class.

@throws ServiceException Thrown if there is an error or if the user is
not privileged in the class nor are they an
admin.
Checks if the user is privileged in the class or an admin . @param classId The class to check if the user is privileged . @param username The user to check if they are privileged in the class . @throws ServiceException Thrown if there is an error or if the user is not privileged in the class nor are they an admin .
public void userIsAdminOrPrivileged(final String classId, 
			final String username) throws ServiceException {
		try {
			if((! Clazz.Role.PRIVILEGED.equals(userClassQueries.getUserClassRole(classId, username))) &&
			   (! userQueries.userIsAdmin(username))) {
				throw new ServiceException(
						ErrorCode.CLASS_INSUFFICIENT_PERMISSIONS, 
						"The user is not privileged in the class.");
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void userIsAdminOrPrivileged ( final String classId , final String username ) throws ServiceException { try { if ( ( ! Clazz . Role . PRIVILEGED . equals ( userClassQueries . getUserClassRole ( classId , username ) ) ) && ( ! userQueries . userIsAdmin ( username ) ) ) { throw new ServiceException ( ErrorCode . CLASS_INSUFFICIENT_PERMISSIONS , "The user is not privileged in the class." ) ; } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Checks if the user is privileged in the class or an admin.
Checks if the user is privileged in the class or an admin .