1

Scenario:

"Teams" content type has user entity reference field.

"Manager" role can add teams to nodes they have created and the teams will change often.

Members of the team can only view the nodes (and nodes that reference that node through another entity reference field) whenever their team is assigned to them.

For these content types, performance isn't an issue. What I want to do is use a series of views_get_view_result when the node is viewed and redirect away from the node if necessary. That part is easy.

What is the best hook to use for when the node is viewed and I can run my views to find out if the user should view it?

Thanks

0

In similar situation I used hook_entity_access. Also there is hook_ENTITY_TYPE_access so you can use the hook_node_access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.