diff --git a/core/modules/filter/src/FilterFormatAccessControlHandler.php b/core/modules/filter/src/FilterFormatAccessControlHandler.php index 090944aa08d192366fc6dfd2e2d5d7d670e0dd12..2dcb6dc7d1ef73a939a0ddae7d2641496509be23 100644 --- a/core/modules/filter/src/FilterFormatAccessControlHandler.php +++ b/core/modules/filter/src/FilterFormatAccessControlHandler.php @@ -41,7 +41,7 @@ protected function checkAccess(EntityInterface $filter_format, $operation, Accou return AccessResult::forbidden(); } - if (in_array($operation, ['disable', 'update'])) { + if (in_array($operation, ['disable', 'update', 'view'])) { return parent::checkAccess($filter_format, $operation, $account); } diff --git a/core/modules/hal/tests/src/Functional/EntityResource/FilterFormat/FilterFormatHalJsonAnonTest.php b/core/modules/hal/tests/src/Functional/EntityResource/FilterFormat/FilterFormatHalJsonAnonTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b0d1a6103df40adc8b47b1dbc3bf9fc5954d92c1 --- /dev/null +++ b/core/modules/hal/tests/src/Functional/EntityResource/FilterFormat/FilterFormatHalJsonAnonTest.php @@ -0,0 +1,30 @@ +grantPermissionsToTestedRole(['administer filters']); + } + + /** + * {@inheritdoc} + */ + protected function createEntity() { + $pablo_format = FilterFormat::create([ + 'name' => 'Pablo Piccasso', + 'format' => 'pablo', + 'langcode' => 'es', + 'filters' => [ + 'filter_html' => [ + 'status' => TRUE, + 'settings' => [ + 'allowed_html' => '

', + ], + ], + ], + ]); + $pablo_format->save(); + return $pablo_format; + } + + /** + * {@inheritdoc} + */ + protected function getExpectedNormalizedEntity() { + return [ + 'dependencies' => [], + 'filters' => [ + 'filter_html' => [ + 'id' => 'filter_html', + 'provider' => 'filter', + 'status' => TRUE, + 'weight' => -10, + 'settings' => [ + 'allowed_html' => '

', + 'filter_html_help' => TRUE, + 'filter_html_nofollow' => FALSE, + ], + ], + ], + 'format' => 'pablo', + 'langcode' => 'es', + 'name' => 'Pablo Piccasso', + 'status' => TRUE, + 'uuid' => $this->entity->uuid(), + 'weight' => 0, + ]; + } + + /** + * {@inheritdoc} + */ + protected function getNormalizedPostEntity() { + // @todo Update in https://www.drupal.org/node/2300677. + } + +}