Skip to content
Snippets Groups Projects
Commit 9c86984c authored by catch's avatar catch
Browse files

Issue #2241229 by Wim Leers: Followup: Aggregator Feed & Item content entity...

Issue #2241229 by Wim Leers: Followup: Aggregator Feed & Item content entity types, and AggregatorFeedBlock should use cache tags.
parent 7a9fae8f
No related branches found
No related tags found
No related merge requests found
<?php
/**
* @file
* Contains \Drupal\aggregator\ItemAccessController.
*/
namespace Drupal\aggregator;
use Drupal\Core\Entity\EntityAccessController;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
/**
* Defines an access controller for the item entity.
*
* @see \Drupal\aggregator\Entity\Item
*/
class ItemAccessController extends EntityAccessController {
/**
* {@inheritdoc}
*/
protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
switch ($operation) {
case 'view':
return $account->hasPermission('access news feeds');
break;
default:
return $account->hasPermission('administer news feeds');
break;
}
}
/**
* {@inheritdoc}
*/
protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
return $account->hasPermission('administer news feeds');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment