I tried to set role-based permissions on the field_collection field to control who can edit/view items but it doesn't work. I assume field permissions module is not yet supported. Will it be supported in the future? Is there a workaround for the meantime?

Comments

westbywest’s picture

Here is what I'm using:

Drupal 7.7
field_collections v7.x-1.x-dev (downloaded last week)
field_permissions v7.x-1.0-alpha1

My symptoms:

- Fields in the collection which are restricted from edit are correctly hidden on a node form to users who don't have those fields' edit permissions
- Fields in the collection which are restricted from view are incorrectly displayed in the rendered node
- Submitting the node edit form, although restricted fields in the collection are not displayed, triggers these undefined index warnings for each restricted field:

Notice: Undefined index: #title in theme_field_collection_table_multiple_value_fields() (line 85 of /blah/blah/blah/sites/all/modules/field_collection_table/theme/theme.inc)

Here are relevant lines I've found in the field_permissions in my own search where this integration may be added:

field_permissions.module
line 115: function field_permissions_field_access($op, $field, $obj_type, $object, $account)
admin/includes/field_access.inc
line 11: function _field_permissions_field_view_access($field_name, $field_permissions, $obj_type, $object, $account)
line 63: function _field_permissions_field_edit_access($field_name, $field_permissions, $obj_type, $object, $account)

I've also added an issue to the queue for field_permissions:
http://drupal.org/node/1284016

westbywest’s picture

The 2nd symptom described above was resolved by adding field_access awareness to field_collections_table:
http://drupal.org/node/1284042

adellefrank’s picture

I, too, have found that permissions for VIEWING OWN/EDITING OWN field is not working when that field is a subfield of a field collection.

To reproduce this problem, give View Own/Edit Own permissions to the authenticated user for a field collection "mycollection" and its subfield "subfield1" in a content type's "mytype". I've attached a feature with the setup I described above for testing. This feature uses:

3cwebdev’s picture

Any updates on getting field_collections to support field_permissions?

albert volkman’s picture

jmuzz’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)

This should currently be working in the latest module versions for field collections in a node or user.

See #2825761: Add support for nested field collections for support for field collections nested deeper than this.