src/org/ohmage/service/UserClassServices.java
public void userHasRoleInClass(final String username, 
			final String classId, final Clazz.Role classRole) 
			throws ServiceException {
		
		try {
			if(! userClassQueries.getUserClassRole(classId, username).equals(classRole)) {
				throw new ServiceException(
						ErrorCode.CLASS_INSUFFICIENT_PERMISSIONS, 
						"The user doesn't have sufficient permissions for the following class: " + 
							classId);
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Verifies that the user's role in the class is the same as a given role.
	 * 
	 * @param username The username of the user.
	 * 
	 * @param classId The unique identifier for the class.
	 * 
	 * @param classRole The class role that the user must have in the class.
	 * 
	 * @throws ServiceException Thrown if the user doesn't have the role in the
	 * 							class or if there is an error.
	 */
Verifies that the user's role in the class is the same as a given role.

@param username The username of the user.

@param classId The unique identifier for the class.

@param classRole The class role that the user must have in the class.

@throws ServiceException Thrown if the user doesn't have the role in the
class or if there is an error.
Verifies that the user ' s role in the class is the same as a given role . @param username The username of the user . @param classId The unique identifier for the class . @param classRole The class role that the user must have in the class . @throws ServiceException Thrown if the user doesn ' t have the role in the class or if there is an error .
public void userHasRoleInClass(final String username, 
			final String classId, final Clazz.Role classRole) 
			throws ServiceException {
		try {
			if(! userClassQueries.getUserClassRole(classId, username).equals(classRole)) {
				throw new ServiceException(
						ErrorCode.CLASS_INSUFFICIENT_PERMISSIONS, 
						"The user doesn't have sufficient permissions for the following class: " + 
							classId);
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void userHasRoleInClass ( final String username , final String classId , final Clazz . Role classRole ) throws ServiceException { try { if ( ! userClassQueries . getUserClassRole ( classId , username ) . equals ( classRole ) ) { throw new ServiceException ( ErrorCode . CLASS_INSUFFICIENT_PERMISSIONS , "The user doesn't have sufficient permissions for the following class: " + classId ) ; } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Verifies that the user's role in the class is the same as a given role.
Verifies that the user ' s role in the class is the same as a given role .