You are here

public function ConfigSplitActivateForm::access in Configuration Split 2.0.x

Checks access for a specific request.

Parameters

\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

1 string reference to 'ConfigSplitActivateForm::access'
config_split.routing.yml in ./config_split.routing.yml
config_split.routing.yml

File

src/Form/ConfigSplitActivateForm.php, line 145

Class

ConfigSplitActivateForm
The form for activating a split.

Namespace

Drupal\config_split\Form

Code

public function access(AccountInterface $account) {
  $split = $this
    ->getSplit();
  return AccessResult::allowedIfHasPermission($account, 'administer configuration split')
    ->andIf(AccessResult::allowedIf(!$split
    ->get('status')))
    ->addCacheableDependency($split);
}