agave-tags/tags-core/src/main/java/org/iplantc/service/tags/managers/TagManager.java
/**
	 * Deletes a tag and sends the appropriate notifications. Permissions
	 * are verified prior to deletion.
	 * 
	 * @param tag the tag to delete
	 * @param username the user requesting the detetion
	 * @throws TagException if deletion fails
	 * @throws TagPermissionException if the user does not have permission to delete
	 */
Deletes a tag and sends the appropriate notifications. Permissions
are verified prior to deletion.

@param tag the tag to delete
@param username the user requesting the detetion
@throws TagException if deletion fails
@throws TagPermissionException if the user does not have permission to delete
Deletes a tag and sends the appropriate notifications . Permissions are verified prior to deletion . @param tag the tag to delete @param username the user requesting the detetion @throws TagException if deletion fails @throws TagPermissionException if the user does not have permission to delete
public void deleteUserTag(Tag tag, String username) 
	throws TagException, TagPermissionException 
	{	
		if (tag == null) {
			throw new TagException("No tag specifed for deletion");
		}
		TagPermissionManager pm = new TagPermissionManager(tag);
		if (!pm.canWrite(username)) {
    		throw new TagPermissionException("User does not have permission to delete this tag");
    	}
    	else {
    		getDao().delete(tag);
    		try {
				eventProcessor.processContentEvent(tag, 
						new TagEvent(tag.getUuid(),
								TagEventType.DELETED,
								"Tag was deleted by " + username,
								username));
			} catch (TagEventProcessingException e) {
				log.error("Failed to send tag deletion event for " + tag.getUuid(), e);
			}
			try {
				getEventDao().deleteByTagId(tag.getUuid());
			} catch (TagEventPersistenceException e) {
				log.error("Failed to delete history of tag " + tag.getUuid(), e);
			}
		}
	}
public void deleteUserTag ( Tag tag , String username ) throws TagException , TagPermissionException { if ( tag == null ) { throw new TagException ( "No tag specifed for deletion" ) ; } TagPermissionManager pm = new TagPermissionManager ( tag ) ; if ( ! pm . canWrite ( username ) ) { throw new TagPermissionException ( "User does not have permission to delete this tag" ) ; } else { getDao ( ) . delete ( tag ) ; try { eventProcessor . processContentEvent ( tag , new TagEvent ( tag . getUuid ( ) , TagEventType . DELETED , "Tag was deleted by " + username , username ) ) ; } catch ( TagEventProcessingException e ) { log . error ( "Failed to send tag deletion event for " + tag . getUuid ( ) , e ) ; } try { getEventDao ( ) . deleteByTagId ( tag . getUuid ( ) ) ; } catch ( TagEventPersistenceException e ) { log . error ( "Failed to delete history of tag " + tag . getUuid ( ) , e ) ; } } }
Deletes a tag and sends the appropriate notifications.
Deletes a tag and sends the appropriate notifications .
// tag is already gone. log and swallow this exception