You are here

public function ScheduledUpdateAddController::addFormAccess in Scheduled Updates 8

1 string reference to 'ScheduledUpdateAddController::addFormAccess'
scheduled_updates.routing.yml in ./scheduled_updates.routing.yml
scheduled_updates.routing.yml

File

src/Controller/ScheduledUpdateAddController.php, line 150
Contains Drupal\scheduled_updates\Controller\ScheduledUpdateAddController.

Class

ScheduledUpdateAddController
Class ScheduledUpdateAddController.

Namespace

Drupal\scheduled_updates\Controller

Code

public function addFormAccess(AccountInterface $account, ScheduledUpdateTypeInterface $scheduled_update_type) {
  if ($scheduled_update_type
    ->isEmbeddedType()) {
    return AccessResult::forbidden();
  }
  $type_id = $scheduled_update_type
    ->id();
  return AccessResult::allowedIfHasPermission($account, "create {$type_id} scheduled updates");
}