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

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

@param username The other user's username.

@param documentId The document's unique identifier.

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