Commit 44b98ffa authored by alexpott's avatar alexpott

Issue #2187313 by ParisLiakos: Remove reintroduced category code in aggregator .

parent e7fae35e
......@@ -8,11 +8,3 @@ services:
plugin.manager.aggregator.processor:
class: Drupal\aggregator\Plugin\AggregatorPluginManager
arguments: [processor, '@container.namespaces', '@cache.cache', '@language_manager']
access_check.aggregator.categories:
class: Drupal\aggregator\Access\CategoriesAccessCheck
arguments: ['@database']
tags:
- { name: access_check, applies_to: _access_aggregator_categories }
aggregator.category.storage:
class: Drupal\aggregator\CategoryStorageController
arguments: ['@database']
<?php
/**
* @file
* Contains \Drupal\aggregator\Access\CategoriesAccess.
*/
namespace Drupal\aggregator\Access;
use Drupal\Core\Database\Connection;
use Drupal\Core\Routing\Access\AccessInterface;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Route;
/**
* Provides an access check for aggregator categories routes.
*/
class CategoriesAccessCheck implements AccessInterface {
/**
* The database connection.
*
* @var \Drupal\Core\Database\Connection
*/
protected $database;
/**
* Constructs a CategoriesAccessCheck object.
*
* @param \Drupal\Core\Database\Connection
* The database connection.
*/
public function __construct(Connection $database) {
$this->database = $database;
}
/**
* {@inheritdoc}
*/
public function access(Route $route, Request $request, AccountInterface $account) {
return $account->hasPermission('access news feeds') && (bool) $this->database->queryRange('SELECT 1 FROM {aggregator_category}', 0, 1)->fetchField() ? static::ALLOW : static::DENY;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment