class TourAccessControlHandler

Defines the access control handler for the tour entity type.

Hierarchy

Expanded class hierarchy of TourAccessControlHandler

See also

\Drupal\tour\Entity\Tour

File

core/modules/tour/src/TourAccessControlHandler.php, line 15

Namespace

Drupal\tour
View source
class TourAccessControlHandler extends EntityAccessControlHandler {
  
  /**
   * {@inheritdoc}
   */
  protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
    if ($operation === 'view') {
      return AccessResult::allowedIfHasPermissions($account, [
        'access tour',
        'administer site configuration',
      ], 'OR');
    }
    return parent::checkAccess($entity, $operation, $account);
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.