You are here

class WebformImageSelectAccess 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

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

Hierarchy

Expanded class hierarchy of WebformImageSelectAccess

File

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

Namespace

Drupal\webform_image_select\Access
View source
class WebformImageSelectAccess {

  /**
   * Check that webform image select images source can be updated by a user.
   *
   * @param \Drupal\webform_image_select\WebformImageSelectImagesInterface $webform_image_select_images
   *   A webform image select image entity.
   * @param \Drupal\Core\Session\AccountInterface $account
   *   Run access checks for this account.
   *
   * @return \Drupal\Core\Access\AccessResultInterface
   *   The access result.
   */
  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'));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
WebformImageSelectAccess::checkImagesSourceAccess public static function Check that webform image select images source can be updated by a user.