agave-tags/tags-core/src/main/java/org/iplantc/service/tags/managers/TagPermissionManager.java
/**
	 * Removes all permissions for a user. If the named user is an admin or the 
	 * owner, permission are left in tact. Implied permission cannot change.
	 * 
	 * @param username
	 * @return true if removed, false otherwise.
	 * @throws TagPermissionException
	 * @throws PermissionValidationException 
	 */
Removes all permissions for a user. If the named user is an admin or the
owner, permission are left in tact. Implied permission cannot change.

@param username
@return true if removed, false otherwise.
Removes all permissions for a user . If the named user is an admin or the owner permission are left in tact . Implied permission cannot change . @param username @return true if removed false otherwise .
public boolean removeAllPermissionForUser(String username) 
	throws TagPermissionException, PermissionValidationException 
	{
		if (tag == null) {
			throw new PermissionValidationException("No tag found for permission validation");
		}
		else if (StringUtils.isEmpty(username)) { 
			throw new PermissionValidationException("No username provided.");
		} 
		else if (AuthorizationHelper.isTenantAdmin(username) || isOwner(username)) {
			return false;
		} 
		else {
			TagPermission currentPem = getUserPermission(username);
			if (currentPem.getPermission() != PermissionType.NONE) {
				PermissionDao.delete(currentPem);
				TagEventProcessor eventProcessor = new TagEventProcessor();
				try {
					eventProcessor.processPermissionEvent(tag, currentPem, 
							new TagEvent(tag.getUuid(), 
									TagEventType.PERMISSION_REVOKE, 
									"Permissions revoked for user " + username + " by user " + TenancyHelper.getCurrentEndUser(),
									TenancyHelper.getCurrentEndUser()));
				} catch (TagEventProcessingException e) {
					log.error("Failed to send all permission revocation event for tag " + tag.getUuid(), e);
				}
			}
			else {
			}
			return true;
		}
	}
public boolean removeAllPermissionForUser ( String username ) throws TagPermissionException , PermissionValidationException { if ( tag == null ) { throw new PermissionValidationException ( "No tag found for permission validation" ) ; } else if ( StringUtils . isEmpty ( username ) ) { throw new PermissionValidationException ( "No username provided." ) ; } else if ( AuthorizationHelper . isTenantAdmin ( username ) || isOwner ( username ) ) { return false ; } else { TagPermission currentPem = getUserPermission ( username ) ; if ( currentPem . getPermission ( ) != PermissionType . NONE ) { PermissionDao . delete ( currentPem ) ; TagEventProcessor eventProcessor = new TagEventProcessor ( ) ; try { eventProcessor . processPermissionEvent ( tag , currentPem , new TagEvent ( tag . getUuid ( ) , TagEventType . PERMISSION_REVOKE , "Permissions revoked for user " + username + " by user " + TenancyHelper . getCurrentEndUser ( ) , TenancyHelper . getCurrentEndUser ( ) ) ) ; } catch ( TagEventProcessingException e ) { log . error ( "Failed to send all permission revocation event for tag " + tag . getUuid ( ) , e ) ; } } else { } return true ; } }
Removes all permissions for a user.
Removes all permissions for a user .
// NONE permission are not saved, so nothing needs to be done here.