I'm trying to build a content type where any user can select an entity reference value through an autocompleted Entity Reference field.
Using this field works as an admin. I'm able to see the referenced contents. But when I try as a logged in lambda user, I can't view the content created by other users.
The field is in the content type "Invoice" and has to allow users to select a contact name (content type "Contact").
I think it's a matter of access rights on this specific content type. So far, I've tryed creating a module with a hook_node_access
function :
function contact_node_access($node, $op, $account) {
$type = is_string($node) ? $node : $node->type;
if (in_array($type, node_permissions_get_configured_types())) {
if ($op == 'view' && user_access('view ' . $type . ' content', $account)) {
return NODE_ACCESS_ALLOW;
}
}
}
It still doesn't allow users to see and select other's people contacts.