function EntityLinkSuggestionsController::formatUsesEntityLinksFilter

Checks access based on entity_links filter status on the text format.

Note that access to the filter format is not checked here because the route is configured to check entity access to the filter format.

Parameters

\Drupal\editor\Entity\Editor $editor: The text editor for which to check access.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

1 string reference to 'EntityLinkSuggestionsController::formatUsesEntityLinksFilter'
ckeditor5.routing.yml in core/modules/ckeditor5/ckeditor5.routing.yml
core/modules/ckeditor5/ckeditor5.routing.yml

File

core/modules/ckeditor5/src/Controller/EntityLinkSuggestionsController.php, line 62

Class

EntityLinkSuggestionsController
Returns responses for entity link suggestions autocomplete route.

Namespace

Drupal\ckeditor5\Controller

Code

public static function formatUsesEntityLinksFilter(EditorInterface $editor) : AccessResultInterface {
  $filters = $editor->getFilterFormat()
    ->filters();
  return AccessResult::allowedIf($filters->has('entity_links') && $filters->get('entity_links')->status)
    ->addCacheableDependency($editor);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.