You are here

public function BlockPluginHasSettingsTrayFormAccessCheck::accessBlockPlugin in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/settings_tray/src/Access/BlockPluginHasSettingsTrayFormAccessCheck.php \Drupal\settings_tray\Access\BlockPluginHasSettingsTrayFormAccessCheck::accessBlockPlugin()
  2. 9 core/modules/settings_tray/src/Access/BlockPluginHasSettingsTrayFormAccessCheck.php \Drupal\settings_tray\Access\BlockPluginHasSettingsTrayFormAccessCheck::accessBlockPlugin()

Checks access for accessing a block plugin's 'settings_tray' form.

Parameters

\Drupal\Core\Block\BlockPluginInterface $block_plugin: The block plugin whose 'settings_tray' form is being accessed.

Return value

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

See also

settings_tray_preprocess_block()

1 call to BlockPluginHasSettingsTrayFormAccessCheck::accessBlockPlugin()
BlockPluginHasSettingsTrayFormAccessCheck::access in core/modules/settings_tray/src/Access/BlockPluginHasSettingsTrayFormAccessCheck.php
Checks access for accessing a block's 'settings_tray' form.

File

core/modules/settings_tray/src/Access/BlockPluginHasSettingsTrayFormAccessCheck.php, line 44

Class

BlockPluginHasSettingsTrayFormAccessCheck
Determines whether the requested block has a 'settings_tray' form.

Namespace

Drupal\settings_tray\Access

Code

public function accessBlockPlugin(BlockPluginInterface $block_plugin) {
  return AccessResult::allowedIf($block_plugin instanceof PluginWithFormsInterface && $block_plugin
    ->hasFormClass('settings_tray'));
}