function FeedAccessControlHandler::checkAccess

Same name in other branches
  1. 8.9.x core/modules/aggregator/src/FeedAccessControlHandler.php \Drupal\aggregator\FeedAccessControlHandler::checkAccess()

Overrides EntityAccessControlHandler::checkAccess

File

core/modules/aggregator/src/FeedAccessControlHandler.php, line 20

Class

FeedAccessControlHandler
Defines an access control handler for the feed entity.

Namespace

Drupal\aggregator

Code

protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
    switch ($operation) {
        case 'view':
            return AccessResult::allowedIfHasPermission($account, 'access news feeds');
        default:
            return AccessResult::allowedIfHasPermission($account, 'administer news feeds');
    }
}

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