src/org/ohmage/service/ClassDocumentServices.java
public void ensureRoleHighEnoughToDisassociateDocumentFromClass(
			final Document.Role role, final String classId, 
			final String documentId) throws ServiceException {
		
		Document.Role classDocumentRole = getDocumentRoleForClass(classId, documentId);
		
		if(role.compare(classDocumentRole) < 0) {
			throw new ServiceException(
					ErrorCode.DOCUMENT_INSUFFICIENT_PERMISSIONS, 
					"Insufficient permissions to disassociate the document '" +
						documentId + 
						"' with the class '" + 
						classId + 
						"' as the class has a higher role.");
		}
	}
/**
	 * Verifies that a given role has enough permissions to disassociate a
	 * document and a class based on the class' role with the document.
	 * 
	 * @param role The maximum role of the user that is attempting to 
	 * 			   disassociate the class and document. 
	 * 
	 * @param classId The class' unique identifier.
	 * 
	 * @param documentId The document's unique identifier.
	 * 
	 * @throws ServiceException Thrown if the role is not high enough to
	 * 							disassociate a class and document.
	 */
Verifies that a given role has enough permissions to disassociate a
document and a class based on the class' role with the document.

@param role The maximum role of the user that is attempting to
disassociate the class and document.

@param classId The class' unique identifier.

@param documentId The document's unique identifier.

@throws ServiceException Thrown if the role is not high enough to
disassociate a class and document.
Verifies that a given role has enough permissions to disassociate a document and a class based on the class ' role with the document . @param role The maximum role of the user that is attempting to disassociate the class and document . @param classId The class ' unique identifier . @param documentId The document ' s unique identifier . @throws ServiceException Thrown if the role is not high enough to disassociate a class and document .
public void ensureRoleHighEnoughToDisassociateDocumentFromClass(
			final Document.Role role, final String classId, 
			final String documentId) throws ServiceException {
		Document.Role classDocumentRole = getDocumentRoleForClass(classId, documentId);
		if(role.compare(classDocumentRole) < 0) {
			throw new ServiceException(
					ErrorCode.DOCUMENT_INSUFFICIENT_PERMISSIONS, 
					"Insufficient permissions to disassociate the document '" +
						documentId + 
						"' with the class '" + 
						classId + 
						"' as the class has a higher role.");
		}
	}
public void ensureRoleHighEnoughToDisassociateDocumentFromClass ( final Document . Role role , final String classId , final String documentId ) throws ServiceException { Document . Role classDocumentRole = getDocumentRoleForClass ( classId , documentId ) ; if ( role . compare ( classDocumentRole ) < 0 ) { throw new ServiceException ( ErrorCode . DOCUMENT_INSUFFICIENT_PERMISSIONS , "Insufficient permissions to disassociate the document '" + documentId + "' with the class '" + classId + "' as the class has a higher role." ) ; } }
Verifies that a given role has enough permissions to disassociate a
 document and a class based on the class' role with the document.
Verifies that a given role has enough permissions to disassociate a document and a class based on the class ' role with the document .