Closed (won't fix)
Project:
Node access user reference
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Dec 2011 at 08:01 UTC
Updated:
9 Mar 2016 at 03:14 UTC
Jump to comment: Most recent
Comments
Comment #1
danielb commentedSorry, not familiar with field collection.
Comment #2
btopro commentedField collection is a very popular way of associating an entire grouping of fields to a content type. Effectively you could make a field collection that has a user reference in it and then if they are referenced in the field collection they get permissions on the node they are associated to. It makes use of entity so I notice there are basically two sections in this module that are looking for entity type of node. If an alternate conditional was created for entity_type field_collection would you be willing to accept patches to bring this functionality in?
I'll be needing this functionality in the near future so I'd be happy to write the patch for it. Doesn't seem like it would be too difficult.
Comment #3
gaheinrichs commentedHello,
I am also really interested for a patch. I need specific node access to several users and this two modules are the best thing for that, unfortunately they do not work together for now.
Comment #4
socialnicheguru commentedI'm also interested in the patch.
I was trying to figure out why it wasn't working until I realized that it might not work for field_collection.
thanks!
Comment #5
btopro commentedSo is there no support for entities ? Field collection item is a non node entity type
Comment #6
zilla commentedi'm confused as i was contemplating a similar use case.
why not simply use the "add another" option for the entity reference:user? entity reference module handles this quite well in a very user friendly interface - and assuming that this module easily supports multiple users referenced from the same node, it should be a simple implementation.
at any rate, i don't understand why field collection wouldn't work - it's also an entity and uses the same entity api as entity reference, though it's embedded and maybe is being handled differently or something, no idea.
Comment #7
johnv@zilla, just for info: this happens with more modules: support for FieldCollection and Profile2 needs to be programmatically added. That is because the data is nested 1 (or more) level deeper then normal.
A normal node/entity: $entity->{$field_name}->values
A FieldCollection: $node->{$field_collection_name}->{$field_name}->values
A Profile2: $node->{$profile_name}->{$field_name}->values
Comment #8
btopro commentedfrom looking through, the UI to get the options associated with a reference field is only applied on nodes. I'm not familiar enough with the field UI to know how to get it on there but it shouldn't be a ton of refactoring to support entities w/ fields instead of just nodes with fields.
While the description of a field collection above is correct, if the association was on the entity it'll just be $entity->{$field_name}->values for nodes and everything else (profile2 as well).
Comment #9
liquidcms commentedA couple things about this:
1. yes, this would be a cool feature to be supported
2. should someone attempt the patch, keep in mind that you can have a collection in a collection in a collection, etc; i would guess the correct use of this would be that if a userref was buried somewhere in there that it would be the top level parent (i.e. the entity that the top collection is used on) that would have it's access controlled.
3. i was going to look at doing the patch but my client opted for the cheaper solution of:
- simply add an admin viewable userref field directly to the node
- with hook_node_submit simply fill this new field with the values pulled from the collection
- use this field to control access
something like:
Comment #10
btopro commenteddoi! now that you put it that way I've done this exact approach before just not with the access implication. Good idea! I guess the only thing then would be in an entity_presave or field collection delete hook to ensure that those names were removed.
Comment #11
danielb commentedSorry, I don't think it's going to happen. You'll have to use the workaround as suggested. If someone can provide an easy way this module can attach to field collections (and the case of deeply nested collections) then we can check it out!