class LoftDataGridsPermissions in Loft Data Grids 8
Class LoftDataGridsPermissions
Define permissions for the module based on exporters.
@package Drupal\loft_data_grids
Hierarchy
- class \Drupal\loft_data_grids\LoftDataGridsPermissions uses StringTranslationTrait
 
Expanded class hierarchy of LoftDataGridsPermissions
File
- src/
LoftDataGridsPermissions.php, line 14  
Namespace
Drupal\loft_data_gridsView source
class LoftDataGridsPermissions {
  use StringTranslationTrait;
  /**
   * Return the permissions defined by this module.
   *
   * @return array
   */
  public function permissions() {
    $perms = [];
    foreach (\Drupal::service('loft_data_grids.core')
      ->getExporters(false) as $exporter) {
      $perms['loft_data_grids:' . $exporter['id']] = [
        'title' => $this
          ->t('Visible in UI: @id', [
          '@id' => $exporter['name'],
        ]),
        'description' => Html::escape($exporter['description']),
      ];
    }
    return $perms;
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            LoftDataGridsPermissions:: | 
                  public | function | Return the permissions defined by this module. | |
| 
            StringTranslationTrait:: | 
                  protected | property | The string translation service. | 1 | 
| 
            StringTranslationTrait:: | 
                  protected | function | Formats a string containing a count of items. | |
| 
            StringTranslationTrait:: | 
                  protected | function | Returns the number of plurals supported by a given language. | |
| 
            StringTranslationTrait:: | 
                  protected | function | Gets the string translation service. | |
| 
            StringTranslationTrait:: | 
                  public | function | Sets the string translation service to use. | 2 | 
| 
            StringTranslationTrait:: | 
                  protected | function | Translates a string to the current language or to a given language. |