public function OpenIDConnectAccountsForm::access in OpenID Connect / OAuth client 8
Same name and namespace in other branches
- 2.x src/Form/OpenIDConnectAccountsForm.php \Drupal\openid_connect\Form\OpenIDConnectAccountsForm::access()
Checks access for the OpenID-Connect accounts form.
Parameters
\Drupal\Core\Session\AccountInterface $user: The user having accounts.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
1 string reference to 'OpenIDConnectAccountsForm::access'
File
- src/
Form/ OpenIDConnectAccountsForm.php, line 229
Class
- OpenIDConnectAccountsForm
- Provides the user-specific OpenID Connect settings form.
Namespace
Drupal\openid_connect\FormCode
public function access(AccountInterface $user) {
if ($this->currentUser
->hasPermission('administer users')) {
return AccessResult::allowed();
}
if ($this->currentUser
->id() && $this->currentUser
->id() === $user
->id() && $this->currentUser
->hasPermission('manage own openid connect accounts')) {
return AccessResult::allowed();
}
return AccessResult::forbidden();
}