Score:1

Access permissions with the Entity Print module

in flag

I installed the Entity Print on my site. It works perfectly when used from the administrator user, but it doesn't work with anonymous users.

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 code.

// 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();

The anonymous user doesn't have the permission to view this content type. I went to the permissions list page and found for each content type the following permissions, but not the permission to view a specific content type.

  • View revisions
  • Create
  • Delete

I have the Domain Access Entity and the Domain Access modules installed.

How can I make return $access_result->andIf($entity->access('view', $account, TRUE)); return true?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.