Hello, I'm having the following issue:

I've got the first user reference field, called "Participants". It is set up, so when it is used, only the selected users can view the node.

I've got a second field, called "Facilitators". It is set up, so when it is used, only the selected users can update and/or delete the node.

When both are not used, everyone can see the node and me (the admin) can update/delete it cause of my bypassing all permissions.

When I add a user as a "Facilitator", the other field's permission granting (in our case, allowing everyone to view the node - since it's still not being used) breaks and I end up with the user added as "Facilitator" being able to update/delete the node, but noone (apart from the admin) to be able to view it.

I don't know if it's a bug or something I haven't set up correctly and I look forward to hearing from you.

Comments

magtak’s picture

On top of that, If I pick the "dirty way" of selecting all users in the "Participants" list, Anonymous users seem to be ignored - they can't view the node.

magtak’s picture

Also tried setting the two fields' Priority values differently but that didn't seem to do any difference at all.

magtak’s picture

Status: Active » Closed (works as designed)

Having a look at your code I realized that this is not the module's intended use. You only use one realm for your grants. Had to write my own to implement different access groups upon one node.

tammo’s picture

Hi Magtak, we are facing the same problem. Is there a possibility we may explore your solution?

Tammo
Tools for Research

magtak’s picture

In a nutshell, fire up your own custom_content_access module and implement (at least) these 2 functions:

hook_content_access_node_access_records($node) in order to set the node's grants in the database, and

hook_content_access_node_grants($account, $op) in order to give grants to users accordingly.

In my case I copied NAURs logic but using two different realms of grants, one for viewing and one for editing the node according to the field the users were referenced from.

Send me an email if you need more information.