upgrades core to 8.4.2
This commit is contained in:
@@ -13,8 +13,10 @@ use Drupal\tour\TourInterface;
|
||||
* id = "tour",
|
||||
* label = @Translation("Tour"),
|
||||
* handlers = {
|
||||
* "view_builder" = "Drupal\tour\TourViewBuilder"
|
||||
* "view_builder" = "Drupal\tour\TourViewBuilder",
|
||||
* "access" = "Drupal\tour\TourAccessControlHandler",
|
||||
* },
|
||||
* admin_permission = "administer site configuration",
|
||||
* entity_keys = {
|
||||
* "id" = "id",
|
||||
* "label" = "label"
|
||||
|
||||
@@ -4,8 +4,13 @@ namespace Drupal\tour\Tests;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
||||
@trigger_error('\Drupal\tour\Tests\TourTestBase is deprecated in 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\tour\Functional\TourTestBase.', E_USER_DEPRECATED);
|
||||
|
||||
/**
|
||||
* Base class for testing Tour functionality.
|
||||
*
|
||||
* @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0.
|
||||
* Use \Drupal\Tests\tour\Functional\TourTestBase instead.
|
||||
*/
|
||||
abstract class TourTestBase extends WebTestBase {
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\tour;
|
||||
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
use Drupal\Core\Entity\EntityAccessControlHandler;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
|
||||
/**
|
||||
* Defines the access control handler for the tour entity type.
|
||||
*
|
||||
* @see \Drupal\tour\Entity\Tour
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user