langcode: en
status: true
dependencies:
  module:
    - eca_config
    - eca_user
    - modeler_api
third_party_settings:
  modeler_api:
    modeler_id: bpmn_io
    data: 'hash:81ac85c6ce78896e329d2292bcc27b80'
    label: 'Grant media type permissions'
    documentation: 'When a new media type is created, permissions to work with it are automatically granted to content editors.'
    version: 1.0.0
id: grant_media_type_permissions
weight: 0
template: null
events:
  config__save_1_1:
    plugin: 'config:save'
    label: 'Media type created'
    configuration:
      config_name: media.type.
      sync_mode: ''
      write_mode: new
    successors:
      -
        id: eca_switch_account_0dshb6m
        condition: ''
conditions: {  }
gateways: {  }
actions:
  eca_config_action_1p0ypjk:
    label: 'Grant permissions'
    plugin: eca_config_action
    configuration:
      action_id: 'entity_method:user.role:grantPermissions'
      config_name: user.role.content_editor
      data: '["create [config:id] media", "delete any [config:id] media", "edit any [config:id] media", "use media [config:id] bulk upload form"]'
    successors: {  }
  eca_switch_account_0dshb6m:
    label: 'Temporarily become administrator'
    plugin: eca_switch_account
    configuration:
      user_id: '1'
    successors:
      -
        id: eca_config_action_1p0ypjk
        condition: ''
