Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\search\SearchPageAccessControlHandler.
|
||||
*/
|
||||
|
||||
namespace Drupal\search;
|
||||
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
|
@ -27,21 +22,21 @@ class SearchPageAccessControlHandler extends EntityAccessControlHandler {
|
|||
/** @var $entity \Drupal\search\SearchPageInterface */
|
||||
if (in_array($operation, array('delete', 'disable'))) {
|
||||
if ($entity->isDefaultSearch()) {
|
||||
return AccessResult::forbidden()->cacheUntilEntityChanges($entity);
|
||||
return AccessResult::forbidden()->addCacheableDependency($entity);
|
||||
}
|
||||
else {
|
||||
return parent::checkAccess($entity, $operation, $account)->cacheUntilEntityChanges($entity);
|
||||
return parent::checkAccess($entity, $operation, $account)->addCacheableDependency($entity);
|
||||
}
|
||||
}
|
||||
if ($operation == 'view') {
|
||||
if (!$entity->status()) {
|
||||
return AccessResult::forbidden()->cacheUntilEntityChanges($entity);
|
||||
return AccessResult::forbidden()->addCacheableDependency($entity);
|
||||
}
|
||||
$plugin = $entity->getPlugin();
|
||||
if ($plugin instanceof AccessibleInterface) {
|
||||
return $plugin->access($operation, $account, TRUE)->cacheUntilEntityChanges($entity);
|
||||
return $plugin->access($operation, $account, TRUE)->addCacheableDependency($entity);
|
||||
}
|
||||
return AccessResult::allowed()->cacheUntilEntityChanges($entity);
|
||||
return AccessResult::allowed()->addCacheableDependency($entity);
|
||||
}
|
||||
return parent::checkAccess($entity, $operation, $account);
|
||||
}
|
||||
|
|
Reference in a new issue