class LayoutPreviewAccessAllowed in Drupal 8
Same name and namespace in other branches
- 9 core/modules/layout_builder/src/Access/LayoutPreviewAccessAllowed.php \Drupal\layout_builder\Access\LayoutPreviewAccessAllowed
- 10 core/modules/layout_builder/src/Access/LayoutPreviewAccessAllowed.php \Drupal\layout_builder\Access\LayoutPreviewAccessAllowed
Accessible class to allow access for inline blocks in the Layout Builder.
@internal Tagged services are internal.
Hierarchy
- class \Drupal\layout_builder\Access\LayoutPreviewAccessAllowed implements AccessibleInterface
Expanded class hierarchy of LayoutPreviewAccessAllowed
2 files declare their use of LayoutPreviewAccessAllowed
- BlockComponentRenderArray.php in core/
modules/ layout_builder/ src/ EventSubscriber/ BlockComponentRenderArray.php - BlockComponentRenderArrayTest.php in core/
modules/ layout_builder/ tests/ src/ Unit/ BlockComponentRenderArrayTest.php
File
- core/
modules/ layout_builder/ src/ Access/ LayoutPreviewAccessAllowed.php, line 15
Namespace
Drupal\layout_builder\AccessView source
class LayoutPreviewAccessAllowed implements AccessibleInterface {
/**
* {@inheritdoc}
*/
public function access($operation, AccountInterface $account = NULL, $return_as_object = FALSE) {
if ($operation === 'view') {
return $return_as_object ? AccessResult::allowed() : TRUE;
}
// The layout builder preview should only need 'view' access.
return $return_as_object ? AccessResult::forbidden() : FALSE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LayoutPreviewAccessAllowed:: |
public | function |
Checks data value access. Overrides AccessibleInterface:: |