You are here

public function AssignUserForm::access in Workbench Access 8

Checks access to the form from the route.

This form is only visible on accounts that can use Workbench Access, regardless of the current user's permissions.

Parameters

\Drupal\Core\Session\AccountInterface $account: The account accessing the form.

\Drupal\Core\Session\AccountInterface $user: The user being edited.

1 string reference to 'AssignUserForm::access'
workbench_access.routing.yml in ./workbench_access.routing.yml
workbench_access.routing.yml

File

src/Form/AssignUserForm.php, line 113

Class

AssignUserForm
Builds the workbench_access set switch form.

Namespace

Drupal\workbench_access\Form

Code

public function access(AccountInterface $account, AccountInterface $user) {
  return AccessResult::allowedIf($user
    ->hasPermission('use workbench access'));
}