YamlFormOptionsAccessControlHandler.php in YAML Form 8
Namespace
Drupal\yamlformFile
src/YamlFormOptionsAccessControlHandler.phpView source
<?php
namespace Drupal\yamlform;
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 form options entity type.
*
* @see \Drupal\yamlform\Entity\YamlFormOptions.
*/
class YamlFormOptionsAccessControlHandler extends EntityAccessControlHandler {
/**
* {@inheritdoc}
*/
public function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
return AccessResult::allowedIf($account
->hasPermission('administer yamlform'))
->cachePerPermissions();
}
}
Classes
Name | Description |
---|---|
YamlFormOptionsAccessControlHandler | Defines the access control handler for the form options entity type. |