Hello, thank you for your module, but I ran into issues with access permission when entity type is using Layout Builder. Problem is that every core block check for access separately. Fields are hidden from anonymous users.

FieldBlock.php

protected function blockAccess(AccountInterface $account) {
    $entity = $this->getEntity();

    // First consult the entity.
    $access = $entity->access('view', $account, TRUE);
    if (!$access->isAllowed()) {
      return $access;
    }
}

Any idea how to solve this?

Comments

parisek created an issue. See original summary.

parisek’s picture

I found https://www.drupal.org/project/access_unpublished/ which works great with Layout Builder

dj1999’s picture

Status: Active » Needs review
StatusFileSize
new1.2 KB

Here the patch please review it.

dj1999’s picture

StatusFileSize
new1.2 KB
mhavelant’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, thanks!

  • mhavelant committed 17e881c on 8.x-1.x authored by dj1999
    Issue #3089615 by dj1999, parisek: Compatibility with Layout Builder
    
mhavelant’s picture

Status: Reviewed & tested by the community » Fixed

Added to beta2, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.