You are here

public static function WebformImageSelectAccess::checkImagesSourceAccess in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_image_select/src/Access/WebformImageSelectAccess.php \Drupal\webform_image_select\Access\WebformImageSelectAccess::checkImagesSourceAccess()

Check that webform image select images source can be updated by a user.

Parameters

\Drupal\webform_image_select\WebformImageSelectImagesInterface $webform_image_select_images: A webform image select image 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 'WebformImageSelectAccess::checkImagesSourceAccess'
webform_image_select.routing.yml in modules/webform_image_select/webform_image_select.routing.yml
modules/webform_image_select/webform_image_select.routing.yml

File

modules/webform_image_select/src/Access/WebformImageSelectAccess.php, line 25

Class

WebformImageSelectAccess
Defines the custom access control handler for the webform image select images entity.

Namespace

Drupal\webform_image_select\Access

Code

public static function checkImagesSourceAccess(WebformImageSelectImagesInterface $webform_image_select_images, AccountInterface $account) {
  return $webform_image_select_images
    ->access('update', $account, TRUE)
    ->andIf(AccessResult::allowedIfHasPermission($account, 'edit webform source'));
}