Closed (fixed)
Project:
Node access user reference
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 Apr 2011 at 19:43 UTC
Updated:
24 Sep 2011 at 08:38 UTC
When author selects no users in user reference field - node displays for everyone. How to make node to display only for auhor in that case?
Comments
Comment #1
danielb commentedI normally would use another module to set up default access, something like the "node access" module. Then I use this module to add-on extra node access. I think though now with the configuration to grant the access back to the author, this will happen automatically?
Comment #2
danielb commentedComment #3
johnvReopening this issue, as more people are facing this problem recently, see e.g. #1032562: Does it work in D7?
February 7th, this patch has been committed, which might be related, and may have changed behaviour: #1043962: Allow anyone to view a node
This is my constellation for a user reference field, with NAUR as my only contrib access module:
Grants for referenced users : [x]View/[]Update/[]Delete
Grants for author : [x]View/[x]Update/[x]Delete
Grants for all users : []View
IMO only author has access if user-reference-field is empty and when 'Grants for all users' = empty.
If you think this issue Works As Designed, there might be some clarification of the helptexts:
- With 'Grants for all users' = X, the helptext is not clear who gets exactly granted: 'All users with any role' or 'All users with User roles that can be referenced'?
- The following helptexts are complex, and I don't understand what you exactly mean:
"These content access permissions will be granted to the authors of nodes affected by grants given to referenced users.
"These content access permissions will be granted to all users for nodes affected by grants given to referenced users.
Would this be clearer, whilst meaning the same?:
"These content access permissions will be granted to ... of nodes of this content type.
Comment #4
danielb commentedMy earlier advice was wrong. The 'author' and 'all' grants are only added to nodes when users are selected, i.e. the module is affecting the node.
All users means all users... everyone. Nothing to do with roles or anything. I don't really think I can clarify this by discrediting all possible misconceptions anyone might have.
No that doesn't mean the same thing. The grants apply to nodes with certain conditions, as stated, not all nodes of a particular content type.
A possible change I could do is to allow configuration of whether the 'author' grant applies even when the user reference field isn't being used. That would address the OP's config problem, but of course it's even more to think about when setting up a field.
These problems all come from misconceptions that this module (and others like it) are designed to deny access.
Comment #5
johnvSo "nodes affected by grants given to referenced users" are nodes of which acces is changed by this module?
Indeed, not everyone knows that access modules only give acces, and not deny access. However, The first node_access module that is activated in a system does deny access: core drupal does not have the permission 'view {content type}', only edit/delete {content type}. That's what this issue is about.
I am looking forward for your opinion after a few nights sleep :-)
Comment #6
danielb commentedThinking of making it like this:
The new config item at the bottom would determine whether to go ahead with the "author" and "all" grants. And if that doesn't do enough we can always add persistent grants for User 1 (who can see it anyway) to force consistency.
Comment #7
danielb commentedI've committed that to git and it will appear in the next dev snapshot.
Comment #8
danielb commentedSuppose it should be backported too.
Comment #9
danielb commentedComment #11
timofey commentedWhen you select
Grants for all users:
[x] View
it does this:
Grants for all users:
[x] View
[x] Update
[x] Delete
basically when the 'grants for all users' are set to 'view', it gives all users the ability to edit the content, regardless of them being referenced by the node.
Comment #12
danielb commentedwtf, there is no such setting, you might be thinking of author? Start a new issue if you can prove this module is doing something wrong, like with the Devel node access block.
Comment #13
timofey commentedHi Daniel,
Yeah, I totally misunderstood the module functionality.
Anyways - great work!