Bind AssetSources to a ResourceCollection
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
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!
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 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.