public static function WebformOptionsCustomAccess::checkOptionsCustomSourceAccess in Webform 8.5
Same name and namespace in other branches
- 6.x modules/webform_options_custom/src/Access/WebformOptionsCustomAccess.php \Drupal\webform_options_custom\Access\WebformOptionsCustomAccess::checkOptionsCustomSourceAccess()
Check that webform options custom source can be updated by a user.
Parameters
\Drupal\webform_options_custom\WebformOptionsCustomInterface $webform_options_custom: A webform options custome entity.
\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
1 string reference to 'WebformOptionsCustomAccess::checkOptionsCustomSourceAccess'
- webform_options_custom.routing.yml in modules/
webform_options_custom/ webform_options_custom.routing.yml - modules/webform_options_custom/webform_options_custom.routing.yml
File
- modules/
webform_options_custom/ src/ Access/ WebformOptionsCustomAccess.php, line 25
Class
- WebformOptionsCustomAccess
- Defines the custom access control handler for the webform options custom entity.
Namespace
Drupal\webform_options_custom\AccessCode
public static function checkOptionsCustomSourceAccess(WebformOptionsCustomInterface $webform_options_custom, AccountInterface $account) {
return $webform_options_custom
->access('update', $account, TRUE)
->andIf(AccessResult::allowedIfHasPermission($account, 'edit webform source'));
}