You are here

class DeployPermissions in Deploy - Content Staging 8

Defines permissions for Deploy module.

Hierarchy

Expanded class hierarchy of DeployPermissions

File

src/DeployPermissions.php, line 11

Namespace

Drupal\deploy
View source
class DeployPermissions {
  use StringTranslationTrait;

  /**
   * Generates the permissions for workspace pointer entities.
   *
   * @return array
   *   The permissions for workspace pointer entities.
   */
  public function workspacePointerPermissions() {
    $permissions = [];
    $workspace_pointers = WorkspacePointer::loadMultiple();
    foreach ($workspace_pointers as $workspace_pointer) {
      $permissions['Deploy to ' . $workspace_pointer
        ->label()] = [
        'title' => $this
          ->t('Deploy to @workspace_pointer', [
          '@workspace_pointer' => $workspace_pointer
            ->label(),
        ]),
      ];
    }
    return $permissions;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeployPermissions::workspacePointerPermissions public function Generates the permissions for workspace pointer entities.
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.