You are here

Permissions.php in Lightning Workflow 8.3

Same filename and directory in other branches
  1. 8.2 modules/lightning_scheduler/src/Permissions.php

File

modules/lightning_scheduler/src/Permissions.php
View source
<?php

namespace Drupal\lightning_scheduler;

use Drupal\content_moderation\Permissions as BasePermissions;

/**
 * Exposes permissions for scheduling moderation state changes.
 */
class Permissions extends BasePermissions {

  /**
   * {@inheritdoc}
   */
  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;
  }

}

Classes

Namesort descending Description
Permissions Exposes permissions for scheduling moderation state changes.