You are here

class UsersExportPermissions in Users Export 8

User Export Permissions Class.

Hierarchy

Expanded class hierarchy of UsersExportPermissions

File

src/UsersExportPermissions.php, line 11

Namespace

Drupal\users_export
View source
class UsersExportPermissions {
  use StringTranslationTrait;

  /**
   * Return the permissions defined by this module.
   *
   * @return array
   *   Return perms
   */
  public function permissions() {
    $perms = [];
    if (\Drupal::moduleHandler()
      ->moduleExists('loft_data_grids')) {
      foreach (\Drupal::service('loft_data_grids.core')
        ->getExporters(FALSE) as $info) {
        $perms['users_export:export as ' . $info['id']] = [
          'title' => $this
            ->t('Export as @name', [
            '@name' => $info['name'],
          ]),
          'description' => Html::escape($info['description']),
        ];
      }
    }
    return $perms;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
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.
UsersExportPermissions::permissions public function Return the permissions defined by this module.