DeployPermissions.php in Deploy - Content Staging 8
File
src/DeployPermissions.php
View source
<?php
namespace Drupal\deploy;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\workspace\Entity\WorkspacePointer;
class DeployPermissions {
use StringTranslationTrait;
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;
}
}