public function BlocksRendererHelper::isAccessForbidden in Gutenberg 8
Check if the access for current user is forbidden.
Parameters
\Drupal\Core\Block\BlockPluginInterface $plugin_block: Block Plugin instance.
Return value
bool True if access if forbidden, false otherwise.
File
- src/
BlocksRendererHelper.php, line 118
Class
- BlocksRendererHelper
- Class BlocksRendererHelper.
Namespace
Drupal\gutenbergCode
public function isAccessForbidden(BlockPluginInterface $plugin_block) {
$access_result = $plugin_block
->access($this->currentUser);
// $access_result can be boolean or an AccessResult class.
return is_object($access_result) && $access_result
->isForbidden() || is_bool($access_result) && !$access_result;
}