This repository has been archived on 2025-09-29. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
drupalcampbristol/web/modules/contrib/webform/src/WebformOptionsAccessControlHandler.php
2017-03-16 15:29:07 +00:00

24 lines
657 B
PHP

<?php
namespace Drupal\webform;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityAccessControlHandler;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
/**
* Defines the access control handler for the webform options entity type.
*
* @see \Drupal\webform\Entity\WebformOptions.
*/
class WebformOptionsAccessControlHandler extends EntityAccessControlHandler {
/**
* {@inheritdoc}
*/
public function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
return AccessResult::allowedIf($account->hasPermission('administer webform'))->cachePerPermissions();
}
}