Most contrib modules seem to provide configurable permissions for actions, and a client of mine had a requirement to provide more granularity as to who sees editable fields. You could theoretically provide a bunch of different view modes for the content in question, and serve them up based on some arbitrary rules, but that's a lot of work for something that should be handled by user_access().

Attached is a straightforward patch to provide a permission and test against it alongside update access for the content in question.

CommentFileSizeAuthor
editablefields-perm.patch1.22 KBbradjones1
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kingdee40’s picture

This works well, without the need for custom hook_permission.
Just set the permissions on editablefields and on the node.

bradjones1’s picture

@kingdee - Could you clarify, do you mean this patch is unnecessary due to existing functionality I overlooked? Right now editablefields doesn't provide any permissions, hence my adding the hook, here. Or am I misunderstanding you?

kingdee40’s picture

Sorry, what I meant was your patch works better then the other option http://drupal.org/node/1344634 which requires a custom hook_permission.

bradjones1’s picture

Thanks. Feel free to mark RTBC then :-)

kingdee40’s picture

Status: Needs review » Reviewed & tested by the community

I have this patch running on several dev sites, permissions are working well.

MGParisi’s picture

Tested!

dags’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x-1.x. Thanks.

haegar der schreckliche’s picture

Status: Fixed » Active

Using this patch I cannot see any editable fields in my views anymore. I am using the field_permissions module to set permissions.

dags’s picture

Status: Active » Postponed (maintainer needs more info)

Could you please describe your content type configuration and field_permission configuration in more detail?

haegar der schreckliche’s picture

Status: Postponed (maintainer needs more info) » Fixed

Sorry, my fault.
I should have mentioned that the "Use editablefields" permission field did not show up for me even though I cleared the caches. I still don't know why this happened.
But now one day later it suddenly appeared and everything is fine.

Status: Fixed » Closed (fixed)

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

ncarty97’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha2
Status: Closed (fixed) » Active

I am using the alpha 2 release now and the 'Use editablefields" permission is no where to be found. I have cleared the caches.

I am using this module for a view of inventory from drupal commerce. The role I created to manage that can see the view, but the editable fields are not available to the role. Assigning a role of adminstrator to the user makes them available.

dags’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev
Status: Active » Closed (fixed)

Bugs are fixed in the dev branch - it's not possible to go back and fix alpha2. Try using the dev branch.

dags’s picture

Issue summary: View changes

Cleanup summary