You are here

public function Permissions::transitionPermissions in Lightning Scheduler 8

Returns an array of transition permissions.

Return value

array The transition permissions.

Overrides Permissions::transitionPermissions

1 string reference to 'Permissions::transitionPermissions'
lightning_scheduler.permissions.yml in ./lightning_scheduler.permissions.yml
lightning_scheduler.permissions.yml

File

src/Permissions.php, line 18

Class

Permissions
@internal This is an internal part of Lightning Scheduler and may be changed or removed at any time without warning. It should not be used by external code in any way.

Namespace

Drupal\lightning_scheduler

Code

public function transitionPermissions() {
  $permissions = parent::transitionPermissions();
  foreach ($permissions as $permission => $info) {
    unset($permissions[$permission]);
    $permission = preg_replace('/^use /', 'schedule ', $permission);

    /** @var \Drupal\Core\StringTranslation\TranslatableMarkup $title */
    $title = $info['title'];
    $info['title'] = $this
      ->t('%workflow workflow: Schedule %transition transition.', $title
      ->getArguments());
    $permissions[$permission] = $info;
  }
  return $permissions;
}