src/org/ohmage/service/UserClassDocumentServices.java
public void userCanAssociateDocumentsWithClass(
			final String username, final String classId) 
			throws ServiceException {
		
		try {
			Clazz.Role classRole = userClassQueries.getUserClassRole(classId, username);
			
			if(classRole == null) {
				throw new ServiceException(
						ErrorCode.DOCUMENT_INSUFFICIENT_PERMISSIONS, 
						"The user is not a member of the following class and, therefore, cannot associate documents with it: " + 
							classId);
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Verifies that the user can associate documents with a class. Currently,
	 * the only restriction is that the user must belong to the class in some
	 * capacity.
	 * 
	 * @param username The username of the user in question.
	 * 
	 * @param classId The class ID of the class in question.
	 * 
	 * @throws ServiceException Thrown if there is an error or if the user 
	 * 							does not belong to the class in any capacity.
	 */
Verifies that the user can associate documents with a class. Currently,
the only restriction is that the user must belong to the class in some
capacity.

@param username The username of the user in question.

@param classId The class ID of the class in question.

@throws ServiceException Thrown if there is an error or if the user
does not belong to the class in any capacity.
Verifies that the user can associate documents with a class . Currently the only restriction is that the user must belong to the class in some capacity . @param username The username of the user in question . @param classId The class ID of the class in question . @throws ServiceException Thrown if there is an error or if the user does not belong to the class in any capacity .
public void userCanAssociateDocumentsWithClass(
			final String username, final String classId) 
			throws ServiceException {
		try {
			Clazz.Role classRole = userClassQueries.getUserClassRole(classId, username);
			if(classRole == null) {
				throw new ServiceException(
						ErrorCode.DOCUMENT_INSUFFICIENT_PERMISSIONS, 
						"The user is not a member of the following class and, therefore, cannot associate documents with it: " + 
							classId);
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void userCanAssociateDocumentsWithClass ( final String username , final String classId ) throws ServiceException { try { Clazz . Role classRole = userClassQueries . getUserClassRole ( classId , username ) ; if ( classRole == null ) { throw new ServiceException ( ErrorCode . DOCUMENT_INSUFFICIENT_PERMISSIONS , "The user is not a member of the following class and, therefore, cannot associate documents with it: " + classId ) ; } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Verifies that the user can associate documents with a class.
Verifies that the user can associate documents with a class .