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

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

@param campaignId The campaign's unique identifier.

@param documentId The document's unique identifier.

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