I havethe module EntityPrint https://www.drupal.org/project/entity_print installed on my site. I works perfectly (creates a pdf) when connected as admin and doesn’t work with an anonymous user. It gives the following error : access denied on the url /entityprint/pdf/node/nid . I tracked the error and found that is was caused by this line:
// Check if the user is allowed to view all bundles of the entity type. $access_result = AccessResult::allowedIfHasPermission($account, 'entity print access type ' . $entity_type); if ($access_result->isAllowed()) { return $access_result->andIf($entity->access('view', $account, TRUE)); } // Check if the user is allowed to view that bundle type. $access_result = AccessResult::allowedIfHasPermission($account, 'entity print access bundle ' . $entity->bundle()); if ($access_result->isAllowed()) { return $access_result->andIf($entity->access('view', $account, TRUE)); } return AccessResult::forbidden();
more specifically here :
return $access_result->andIf($entity->access('view', $account, TRUE));
The anonymous user doesn’t have the view permission of this content type. I went to the permissions list page and found for each content type the following permissions: view revisions, create , delete , but I didn’t find a view content type permission. ps: I have both modules Domain Access Entity and Domain Access installed. any idea how to make return $access_result->andIf($entity->access('view', $account, TRUE));
returns true ?