Here is the patch to enable additional permission which can be use to grant permission to a user (such as view, edit or delete) which is referenced via userreference or nodereference fields.

Comments

kenorb’s picture

Status: Needs review » Closed (fixed)
kenorb’s picture

Status: Closed (fixed) » Needs review
kenorb’s picture

Is this will be implemented?

kenorb’s picture

Status: Needs review » Fixed

Commited, need testing.
I'm not sure about the permission names if they are correct.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

joostvdl’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Status: Closed (fixed) » Active

I tested the dev release but got error's like duplicate keys. I think you better remove this 'feature' and let the module http://drupal.org/project/nodeaccess_userreference handle it.

It works great this combi! Thanks for your part.

kenorb’s picture

Thanks, but this module still doesn't support nodereferences #461360: Node Access based on user reference from related node ;(

kenorb’s picture

kenorb’s picture

Status: Active » Needs review
kenorb’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

captainack’s picture

Priority: Normal » Major
Status: Closed (fixed) » Needs review
StatusFileSize
new3.18 KB

I'm not sure if I should open a new issue for this, but I was finding that this patch sometimes opens unintended access to nodes for some users.

It looks like under the following conditions...
- groups G1, G2, G3, ... have the "edit ____ via ____" permission
- node A has a userreference to user B
- user B is not a member of any groups G*
...user B gets access to node A even though user B shouldn't.

The reason seems to be that the section checking the references is within the loop sweeping all roles.

I'm attaching a patch that appears to fix this for userreferences, but:
1. It needs more testing (I only tested cases where the user SHOULDN'T have access).
2. I had to comment out the nodereference part, because after reading and rereading the code and descriptions of its functionality, because
a) I still don't understand what the intended functionality is (i.e. who gets access to what under what conditions).
b) Also, it seems that that functionality has been split off into another (compatible) module anyway.
kenorb, comments and help on this?
3. I'm not sure if a similar bug exists with ____ own ____ content (since it is in the part of the code that loops through all roles). So far, testing on my end seems okay.

Thanks,
Al

captainack’s picture

Title: grand permission via CCK Reference field (nodereference or userreference) » grant permission via CCK Reference field (nodereference or userreference)
kenorb’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.