media-ui icon indicating copy to clipboard operation
media-ui copied to clipboard

Bind AssetSources to a ResourceCollection

Open DrillSergeant opened this issue 5 years ago • 3 comments

Use Case

As an editor I want to be able to store some assets in another assetSource (i.e. to prevent them from being public accessible).

Idea

Part 1: Allow to configure a ResourceCollection for AssetSources

AssetSources should be able to have a ResourceCollection configured:

Neos:
  Media:
    assetSources:
      'neos':
        assetSource: 'Neos\Media\Domain\Model\AssetSource\Neos\NeosAssetSource'
        assetSourceOptions:
          icon: 'resource://Neos.Media/Public/Icons/NeosWhite.svg'
          description: 'Assets in the local asset storage'
          # asyncThumbnails: defaults to the value of Neos:Media:asyncThumbnails
          asyncThumbnails: ~
      'neos-protected':
        assetSource: 'Neos\Media\Domain\Model\AssetSource\Neos\NeosAssetSource'
        assetSourceOptions:
          icon: 'resource://Neos.Media/Public/Icons/NeosWhite.svg'
          description: 'Protected assets in the local asset storage'
          resourceCollection: 'protectedResources'

Part 2: Use the configured ResourceCollection to store assets

This resource collection should be used to store the uploaded asset-resources of this AssetSource.

Part 3: Allow the configuration of allowed assetSources for node properties

  • When displaying the upload-editor for an asset, the assetSource (and it's configured resource collection) should be used to store uploaded assets
  • When showing the media browser overlay of an asset propery, only the configured assetSources should be visible in the media browser overlay

DrillSergeant avatar Jun 22 '20 10:06 DrillSergeant

Addition: The discussed idea was to make it easy to integrate with features like https://github.com/bwaidelich/Wwwision.PrivateResources without adding too much complexity to the UI.

Thanks @bwaidelich and Peter for the fruitful discussion!

Sebobo avatar Jun 23 '20 07:06 Sebobo

I think the AssetSources do not really have the concept of writing, so I find this conflation problematic, as it actually only works with the NeosASsetSource because it does more than asset sources are specified for.

kitsunet avatar Jun 23 '20 11:06 kitsunet

@kitsunet then why do they have a isReadOnly method? I thought there are Asset Sources representing a DAM that allow writing.

Of course the current API doesn‘t seem to fully reflect that/encapsulate this feature, but it looks like it was at least the idea of it.

So at some point I would ask the asset source to import a file if its writable instead of importing it via the resource manager.

Sebobo avatar Jun 23 '20 11:06 Sebobo