public SharedResourcesResponse listSharedWithMe(String bucket, String location, ListSharedResourcesRequest request) {
        Set<ResourceTypes> requestedResourceType = request.getResourceTypes();

        Set<ResourceDescriptor> shareResources = new HashSet<>();
        for (ResourceTypes resourceType : requestedResourceType) {
            ResourceDescriptor sharedResource = getShareResource(ResourceTypes.SHARED_WITH_ME, resourceType, bucket, location);
            shareResources.add(sharedResource);
        }

        Set<MetadataBase> resultMetadata = new HashSet<>();
        for (ResourceDescriptor resource : shareResources) {
            String state = resourceService.getResource(resource);
            SharedResources sharedResources = ProxyUtil.convertToObject(state, SharedResources.class);
            if (sharedResources != null) {
                for (SharedResource sharedResource : sharedResources.getResources()) {
                    ResourceDescriptor sharedResourceDescriptor = ResourceDescriptorFactory.fromPrivateUrl(sharedResource.getUrl(), encryptionService);
                    MetadataBase metadata = sharedResourceDescriptor.isFolder()
                            ? new ResourceFolderMetadata(sharedResourceDescriptor)
                            : new ResourceItemMetadata(sharedResourceDescriptor);
                    metadata.setPermissions(sharedResource.getPermissions());
                    resultMetadata.add(metadata);
                }
            }
        }

        return new SharedResourcesResponse(resultMetadata);
    }
Returns a list of resources shared with user.

@param bucket   - user bucket
@param location - storage location
@param request  - request body
@return list of shared with user resources
server/src/main/java/com/epam/aidial/core/server/service/ShareService.java