agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/managers/MetadataPermissionManager.java
/**
     * Checks whether the given {@code username} has {@link PermissionType#READ},
     * {@link PermissionType#READ_WRITE}, or {@link PermissionType#ALL}
     * for the the {@link MetadataItem} associated with this permission manager.
     *
     * @param username the user to whom the permission will be checked
     * @return true if they have read permission, false otherwise
     */
Checks whether the given  username has  PermissionType#READ,
PermissionType#READ_WRITE, or  PermissionType#ALL
for the the  MetadataItem associated with this permission manager.

@param username the user to whom the permission will be checked
@return true if they have read permission, false otherwise
Checks whether the given username has PermissionType#READ PermissionType#READ_WRITE or PermissionType#ALL for the the MetadataItem associated with this permission manager . @param username the user to whom the permission will be checked @return true if they have read permission false otherwise
public boolean canRead(String username) {
        if (StringUtils.isBlank(username)) {
            return false;
        }
        if (metadataItem == null)
            return getMetadataDao().hasRead(username, uuid);
        if (StringUtils.equals(getAuthenticatedUsername(), username) || AuthorizationHelper.isTenantAdmin(username)
                || StringUtils.equals(getMetadataItem().getOwner(), username))
            return true;
        for (MetadataPermission pem : getMetadataItem().getPermissions()) {
            if (List.of(username, Settings.WORLD_USER_USERNAME, Settings.PUBLIC_USER_USERNAME).contains(pem.getUsername())
                    && pem.canRead()) {
                return true;
            }
        }
        return false;
    }
public boolean canRead ( String username ) { if ( StringUtils . isBlank ( username ) ) { return false ; } if ( metadataItem == null ) return getMetadataDao ( ) . hasRead ( username , uuid ) ; if ( StringUtils . equals ( getAuthenticatedUsername ( ) , username ) || AuthorizationHelper . isTenantAdmin ( username ) || StringUtils . equals ( getMetadataItem ( ) . getOwner ( ) , username ) ) return true ; for ( MetadataPermission pem : getMetadataItem ( ) . getPermissions ( ) ) { if ( List . of ( username , Settings . WORLD_USER_USERNAME , Settings . PUBLIC_USER_USERNAME ) . contains ( pem . getUsername ( ) ) && pem . canRead ( ) ) { return true ; } } return false ; }
Checks whether the given {@code username} has {@link PermissionType#READ},
 {@link PermissionType#READ_WRITE}, or {@link PermissionType#ALL}
 for the the {@link MetadataItem} associated with this permission manager.
Checks whether the given { @code username } has { @link PermissionType#READ } { @link PermissionType#READ_WRITE } or { @link PermissionType#ALL } for the the { @link MetadataItem } associated with this permission manager .