function media_library_test_entity_field_access
Same name in other branches
- 9 core/modules/media_library/tests/modules/media_library_test/media_library_test.module \media_library_test_entity_field_access()
- 10 core/modules/media_library/tests/modules/media_library_test/media_library_test.module \media_library_test_entity_field_access()
- 11.x core/modules/media_library/tests/modules/media_library_test/media_library_test.module \media_library_test_entity_field_access()
Implements hook_entity_field_access().
File
-
core/
modules/ media_library/ tests/ modules/ media_library_test/ media_library_test.module, line 17
Code
function media_library_test_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) {
return AccessResult::forbiddenIf($field_definition->getName() === 'field_media_no_access', 'Field access denied by test module');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.