privilegeTargets:
  'Neos\Flow\Security\Authorization\Privilege\Method\MethodPrivilege':
    'Neos.Media.Browser:Widgets':
      label: Allowed to paginate through assets
      matcher: 'method(Neos\Media\Browser\ViewHelpers\Controller\(Paginate)Controller->(index)Action())'

    'Neos.Media.Browser:ManageAssets':
      label: Allowed to manage assets
      matcher: 'method(Neos\Media\Browser\Controller\(Asset|Image)Controller->(index|new|show|edit|update|initializeCreate|create|replaceAssetResource|updateAssetResource|initializeUpload|upload|tagAsset|delete|createTag|editTag|updateTag|deleteTag|addAssetToCollection|relatedNodes|variants|createVariants)Action()) || method(Neos\Media\Browser\Controller\ImageVariantController->(update)Action())'

    'Neos.Media.Browser:AssetUsage':
      label: Allowed to calculate asset usages
      matcher: 'method(Neos\Media\Browser\Controller\UsageController->relatedNodesAction())'

    'Neos.Media.Browser:ManageTags':
      label: Allowed to mange tags
      matcher: 'method(Neos\Media\Browser\Controller\TagController->(create|edit|update|delete)Action())'

    'Neos.Media.Browser:AssetProxyService':
      label: Allowed to use asset proxies
      matcher: 'method(Neos\Media\Browser\Controller\AssetProxyController->(index|import)Action())'

    'Neos.Media.Browser:ManageAssetCollections':
      label: Allowed to manage asset collections
      matcher: 'method(Neos\Media\Browser\Controller\(Asset|Image)Controller->(createAssetCollection|editAssetCollection|updateAssetCollection|deleteAssetCollection)Action()) || method(Neos\Media\Browser\Controller\AssetCollectionController->(create|edit|update|delete)Action())'

    'Neos.Media.Browser:ReplaceAssetResource':
      label: Allowed to replace asset resources
      matcher: 'method(Neos\Media\Browser\Controller\(Asset|Image)Controller->(replaceAssetResource|updateAssetResource)Action())'

roles:
  'Neos.Neos:AbstractEditor':
    privileges:
      -
        privilegeTarget: 'Neos.Media.Browser:ManageAssets'
        permission: GRANT
      -
        privilegeTarget: 'Neos.Media.Browser:AssetUsage'
        permission: GRANT
      -
        privilegeTarget: 'Neos.Media.Browser:ManageTags'
        permission: GRANT
      -
        privilegeTarget: 'Neos.Media.Browser:AssetProxyService'
        permission: GRANT

  'Neos.Neos:LivePublisher':
    privileges:
      -
        privilegeTarget: 'Neos.Media.Browser:ReplaceAssetResource'
        permission: GRANT

  'Neos.Neos:Administrator':
    privileges:
      -
        privilegeTarget: 'Neos.Media.Browser:ManageAssetCollections'
        permission: GRANT

  'Neos.Flow:Everybody':
    privileges:
      -
        privilegeTarget: 'Neos.Media.Browser:Widgets'
        permission: GRANT
