Move into nested docroot
This commit is contained in:
parent
83a0d3a149
commit
c8b70abde9
13405 changed files with 0 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
name: 'Entity serialization test support'
|
||||
type: module
|
||||
description: 'Provides test support for entity serialization tests.'
|
||||
package: Testing
|
||||
version: VERSION
|
||||
core: 8.x
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Test support module for entity serialization tests.
|
||||
*/
|
||||
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
|
||||
/**
|
||||
* Implements hook_entity_field_access_alter().
|
||||
*
|
||||
* Overrides some default access control to support testing.
|
||||
*
|
||||
* @see Drupal\serialization\Tests\EntitySerializationTest::testUserNormalize()
|
||||
*/
|
||||
function entity_serialization_test_entity_field_access_alter(array &$grants, array $context) {
|
||||
// Override default access control from UserAccessControlHandler to allow
|
||||
// access to 'pass' field for the test user.
|
||||
if ($context['field_definition']->getName() == 'pass' && $context['account']->getUsername() == 'serialization_test_user') {
|
||||
$grants[':default'] = AccessResult::allowed()->inheritCacheability($grants[':default'])->addCacheableDependency($context['items']->getEntity());
|
||||
}
|
||||
}
|
||||
Reference in a new issue