You are here

protected function FeedsPermissions::buildPermissions in Feeds 8.3

Builds a standard list of feeds permissions for a given type.

Parameters

\Drupal\feeds\Entity\FeedType $feed_type: The feed type object.

Return value

array An array of permission names and descriptions.

1 call to FeedsPermissions::buildPermissions()
FeedsPermissions::feedTypePermissions in src/FeedsPermissions.php
Returns an array of feeds type permissions.

File

src/FeedsPermissions.php, line 56

Class

FeedsPermissions
Defines a class containing permission callbacks.

Namespace

Drupal\feeds

Code

protected function buildPermissions(FeedType $feed_type) {
  $args = [
    '%name' => $feed_type
      ->label(),
  ];
  $id = $feed_type
    ->id();
  return [
    "view {$id} feeds" => [
      'title' => $this
        ->t('%name: View feeds', $args),
    ],
    "create {$id} feeds" => [
      'title' => $this
        ->t('%name: Create new feeds', $args),
    ],
    "update {$id} feeds" => [
      'title' => $this
        ->t('%name: Update existing feeds', $args),
    ],
    "delete {$id} feeds" => [
      'title' => $this
        ->t('%name: Delete feeds', $args),
    ],
    "import {$id} feeds" => [
      'title' => $this
        ->t('%name: Import feeds', $args),
    ],
    "schedule_import {$id} feeds" => [
      'title' => $this
        ->t('%name: Import feeds in background', $args),
    ],
    "clear {$id} feeds" => [
      'title' => $this
        ->t('%name: Delete feed items', $args),
    ],
    "unlock {$id} feeds" => [
      'title' => $this
        ->t('%name: Unlock feeds', $args),
      'description' => $this
        ->t('If a feed importation breaks for some reason, users with this permission can unlock it.'),
    ],
  ];
}