You are here

class FeedsTamperPermissions in Feeds Tamper 8.2

Defines a class containing permission callbacks.

Hierarchy

Expanded class hierarchy of FeedsTamperPermissions

File

src/FeedsTamperPermissions.php, line 11

Namespace

Drupal\feeds_tamper
View source
class FeedsTamperPermissions {
  use StringTranslationTrait;

  /**
   * Returns an array of feeds tamper permissions.
   *
   * @return array
   *   An array of permissions.
   */
  public function feedTypeTamperPermissions() {
    $perms = [];
    foreach (FeedType::loadMultiple() as $type) {
      $args = [
        '%name' => $type
          ->label(),
      ];

      /** @var \Drupal\feeds\Entity\FeedType $type */
      $perms['tamper ' . $type
        ->id()] = [
        'title' => $this
          ->t('Tamper %name feed type', $args),
        'description' => $this
          ->t('Create, edit and delete plugins for %name feed type', $args),
      ];
    }
    return $perms;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsTamperPermissions::feedTypeTamperPermissions public function Returns an array of feeds tamper permissions.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.