I believe this should be possible but have not been able to figure out how to do it -- or even find any reference to the issue in the forums.

When a node is restricted to a user via a node_ref field, I need to be able to assign a role or user that can view and edit the node even though they aren't the one referenced.

Obviously the super user can do this but I need to be able to assign this control to a role.

Is this already possible, how?

If not, could a simple permission be created in the permissions table to allow granting "Node_Access_UserRef" override? This would allow a site editor to be able to view and edit the private nodes.

Comments

danielb’s picture

Status: Active » Fixed

You will need to use a seperate node access module (mentioned on the project page). This module only provides access to the referenced users, and leaves other methods of giving access to other modules.

3cwebdev’s picture

Thanks for the fast response! I have looked at the other modules and all seem overly complicated for this simple task -- plus I'm not even sure that any of them would actually provide this functionality.

Any possibility of adding a new permission to this module's permissions that would allow overriding the Node Access User Reference setting by a role that has been set in the permission table.

For example: I have a role called "Content Admin" and I want to grant them ability to view/edit a node even though they are not the user referenced in the node.

danielb’s picture

No, that is absolutely out of scope, and plenty of modules already do what you are asking for. You've got it all twisted around backwards mate. You should use this module to supplement whatever other node access modules you are using, not as the main node access module. http://drupal.org/project/nodeaccess <-- this one can do by user or by role - you set it up once, either per node, or across the whole content type, and then you can ignore it from then on. Complicated shmomplicated!

If I let you assign access by roles, I have to let some other guy assign access by author, or by files, and some other guy access by views, and snoop will want access by shizzle, and someone will want to purchase access, or create some kind of unique default...... fact is there are modules that do all these little things and they shouldn't step onto each other's turf (although some do!) as Drupal's node access system was designed to allow the modules to work together.

3cwebdev’s picture

Status: Fixed » Closed (fixed)

I understand. Thanks for the reply and information. I will try to find the right module to add the override role I need, or write one to handle this little bit of functionality. Thanks again.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Update

Just wanted to post back in case anyone else is having trouble accomplishing the same thing. The nodeaccess module allowed me to easily add the 'role override' I was looking for. It perfectly complimented the Node Access User Reference module and allowed me to set up defaults by content type. Perfect.

ressa’s picture

Version: 6.x-2.2 » 6.x-2.5
Status: Closed (fixed) » Active

Thank you for a great module!

You should use this module to supplement whatever other node access modules you are using, not as the main node access module.

I think this is crucial for new users looking at the Node Access User Reference module to understand. This is somewhat contrary to what is stated on the Overview of Node Access modules:

In general, you don't want to use more than one node access module on your site.

I wanted to grant View access to certain nodes for a specific user, and hide all other nodes, and it took some time to understand how I could do this with the module.

I think adding the line "You should use this module to supplement whatever other node access modules you are using, not as the main node access module." on the module project page and in the README.TXT would be beneficial for new users of this great module.

Thanks.

danielb’s picture

Status: Active » Closed (fixed)

But that isn't necessarily correct. I have used this module by itself, that was the case I designed it for.

The advice you have received from that other documentation is incorrect too. That's not my problem. The drupal node access system in no way requires there to only be one node access module.

ressa’s picture

Yeah, you're right. I now understand slightly better how the Drupal access system works, and am now combining this module with Content Access, and they work beautifully together.

clintthayer’s picture

Version: 6.x-2.5 » 6.x-3.1

Hey danielb,

I'm trying to do a simular task where a role has rights to view/edit, but then have finer control via Node access user reference module. I believe I have things setup correctly, but a user with the "uber role" still can't see the content, or edit.

Node access and NCUR modules both have the same weight set (as per another post on this issue) and I have (what I believe) the correct View/Edit/Delete settings. Rebuild the permissions after edits of both high level node access and NCUR settings. Also edited a specific node and tested, yet no results.

Thoughts?

Azol’s picture

If I let you assign access by roles, I have to let some other guy assign access by author, or by files, and some other guy access by views, and snoop will want access by shizzle, and someone will want to purchase access, or create some kind of unique default......

The problem with this (otherwise) very nice module is that it completely overrides the basic Drupal functionality (user roles permissions) without offering the possibility to respect existing settings.

There is no need to "assign access by roles", the module should just respect existing settings.

2cp.

gianfrasoft’s picture

I wish to add that the nodeaccess module makes you choose the priority level of his rules.

It is important to understand that nodeaccess rules can work at a higher or a lower level than the node access user reference module. It depends on a configuration flag named "Give node grants priority".

Thank you!