class 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 \Drupal\Core\Access\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
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title | 
|---|---|---|---|---|
| LayoutPreviewAccessAllowed::access | public | function | Checks data value access. | Overrides AccessibleInterface::access | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.