agave-systems/systems-core/src/main/java/org/iplantc/service/transfer/model/enumerations/PermissionType.java
/**
	 * Removes the previous permission from the current. If the new and current permission are equivalent, the result
	 * will be {@link #NONE}.
	 * @return the current permission minus the new permission
	 */
Removes the previous permission from the current. If the new and current permission are equivalent, the result
will be  #NONE.
@return the current permission minus the new permission
Removes the previous permission from the current . If the new and current permission are equivalent the result will be #NONE . @return the current permission minus the new permission
public PermissionType remove(PermissionType newPermission)
	{
		if (newPermission.equals(this)) 
		{
			return NONE;
		} 
		else if (newPermission.equals(ALL) || this.equals(ALL)) 
		{
			return NONE;
		} 
		else if (newPermission.canRead() && newPermission.canWrite())
		{
			if (canExecute()) 
				return EXECUTE;
			else 
				return NONE;
		} 
		else if (newPermission.canRead() && newPermission.canExecute())
		{	
			if (canWrite()) 
				return WRITE;
			else 
				return NONE;
		}	
		else if (newPermission.canWrite() && newPermission.canExecute())
		{	
			if (canRead()) 
				return READ;
			else 
				return NONE;
		}
		else if (newPermission.canRead())
		{	
			if (canWrite() && canExecute()) 
				return WRITE_EXECUTE;
			else if (canWrite())
				return WRITE;
			else if (canExecute())
				return EXECUTE;
			else 
				return NONE;
		}
		else if (newPermission.canWrite())
		{	
			if (canRead() && canExecute()) 
				return READ_EXECUTE;
			else if (canRead())
				return READ;
			else if (canExecute())
				return EXECUTE;
			else 
				return NONE;
		}
		else if (newPermission.canExecute())
		{	
			if (canRead() && canWrite()) 
				return READ_WRITE;
			else if (canRead())
				return READ;
			else if (canWrite())
				return WRITE;
			else
				return NONE;
		}
		else {
			return NONE;
		}
	}
public PermissionType remove ( PermissionType newPermission ) { if ( newPermission . equals ( this ) ) { return NONE ; } else if ( newPermission . equals ( ALL ) || this . equals ( ALL ) ) { return NONE ; } else if ( newPermission . canRead ( ) && newPermission . canWrite ( ) ) { if ( canExecute ( ) ) return EXECUTE ; else return NONE ; } else if ( newPermission . canRead ( ) && newPermission . canExecute ( ) ) { if ( canWrite ( ) ) return WRITE ; else return NONE ; } else if ( newPermission . canWrite ( ) && newPermission . canExecute ( ) ) { if ( canRead ( ) ) return READ ; else return NONE ; } else if ( newPermission . canRead ( ) ) { if ( canWrite ( ) && canExecute ( ) ) return WRITE_EXECUTE ; else if ( canWrite ( ) ) return WRITE ; else if ( canExecute ( ) ) return EXECUTE ; else return NONE ; } else if ( newPermission . canWrite ( ) ) { if ( canRead ( ) && canExecute ( ) ) return READ_EXECUTE ; else if ( canRead ( ) ) return READ ; else if ( canExecute ( ) ) return EXECUTE ; else return NONE ; } else if ( newPermission . canExecute ( ) ) { if ( canRead ( ) && canWrite ( ) ) return READ_WRITE ; else if ( canRead ( ) ) return READ ; else if ( canWrite ( ) ) return WRITE ; else return NONE ; } else { return NONE ; } }
Removes the previous permission from the current.
Removes the previous permission from the current .