You are here

protected function MediaBulkConfigPermissions::buildPermissions in Media Bulk Upload 8

Returns a list of node permissions for a given node type.

Parameters

\Drupal\node\Entity\NodeType $type: The node type.

Return value

array An associative array of permission names and descriptions.

1 call to MediaBulkConfigPermissions::buildPermissions()
MediaBulkConfigPermissions::mediaBulkConfigPermissions in src/MediaBulkConfigPermissions.php
Returns an array of node type permissions.

File

src/MediaBulkConfigPermissions.php, line 40

Class

MediaBulkConfigPermissions
Provides dynamic permissions for nodes of different types.

Namespace

Drupal\media_bulk_upload

Code

protected function buildPermissions(MediaBulkConfig $mediaBulkConfig) {
  $mediaBulkConfigId = $mediaBulkConfig
    ->id();
  $type_params = [
    '%type_name' => $mediaBulkConfig
      ->label(),
  ];
  return [
    "use {$mediaBulkConfigId} bulk upload form" => [
      'title' => $this
        ->t('%type_name : Use upload form', $type_params),
    ],
  ];
}