Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When building a site for a client, we often use webform to build a contact form. We would like to allow the client to edit the usual node content at node/[nid]/edit, but restrict access to node/[nid]/webform and the underlying pages. I haven't looked at the code but I think adding a separate permission for this shouldn't be hard to do. Would you consider committing a patch, or is this a "won't fix"?
PS. Searching the webform issue queue for "permission" returns a lot of results, so forgive me if I missed an existing feature request.
Comment | File | Size | Author |
---|---|---|---|
#11 | webform_extra_permissions-D7.zip | 2.51 KB | clemens.tolboom |
#11 | webform_extra_permissions-D7-extra.zip | 2.55 KB | clemens.tolboom |
#9 | webform_extra_permissions_edit.zip | 1.03 KB | undersound3 |
#8 | webform_extra_permissions.zip | 923 bytes | Bartezz |
Comments
Comment #1
quicksketchThis has been brought up before but I'm not sure if it's been as a feature request. My general feeling is that this is an unnecessary complication to introduce to the module. Worse, we'd need to re-implement all node access control systems that are already available to us. By using the same permission as the normal "Edit" permission, the Webform tab immediately works with all access control systems like Node Access, Taxonomy Access, and Organic Groups. All of these modules would need either special-casing for editing Webforms or an add-on module would be necessary (note that we already have a similar problem with the "Results" tab, which is why I had to create OG Webform).
Comment #2
marcvangendOuch, that sounds more complicated than I thought it would be. I'm not an expert on the node access system, obviously :-) I'd love to come up with creative and less complex solutions, but I just don't know enough about this subject. I guess it's time to reach for Pro Drupal Development this weekend...
Comment #3
quicksketchYeah I don't think this will make it into Webform directly, but you could create you own permission checks in a custom module by using hook_menu_alter() and hook_perm().
Comment #4
enkara CreditAttribution: enkara commentedJust to let you know, I would love this functionality too!
Thank you
Comment #5
marcvangendI'll set this to postponed for now and see what I can come up with later, be it a separate module or a patch (less likely, as it seems).
Comment #6
Bartezz CreditAttribution: Bartezz commentedSubscribing
Most of times my clients would like to edit the node (body, title, etc) but they don't have the know-how of editing forms. Therefore I'd like to give them the permission to only edit the node not the webform components or other webform settings.
A similar issue can be found here; http://drupal.org/node/775072
A good start for a patch can be found in the last post in the issue above.
Cheers
Comment #7
marcvangendBartezz, my use case is exactly like yours. Thanks for the link; I wonder why I didn't find it before. I'm marking this as duplicate of #775072: Add 'edit webforms' permission for attached webforms.
Comment #8
Bartezz CreditAttribution: Bartezz commentedFor others bumping into this, I've attached a small module.
I've used the code http://drupal.org/node/775072 in a custom module myself.
But if you're not a coder or aren't using custom modules then the attachment might help you!
- Install module
- Enable 'edit own/any webform content' in admin/user/permissions under 'node module'
- Enable 'edit webform form settings' in admin/user/permissions under 'webform extra permissions' for users allowed to edit per node webform settings, like fields etc....
Cheers
Comment #9
undersound3 CreditAttribution: undersound3 commentedthanks for this module Bartezz
Bumped into a small issue though. Enabling this module will not work because it has an incorrect reference to the webform dependency because of the capital.
dependencies[] = Webform
should be
dependencies[]=webform
After that you are able to enable the module by checking the checkbox.
corrected version attached
Comment #10
Bartezz CreditAttribution: Bartezz commentedAh alright, didn't seem to have that problem myself or did and forgotten about it. Thanx for posting!
Cheers
Comment #11
clemens.tolboomTnx to @Bartezz and @undersound3 I converted their module to a D7 version.
Note that @quicksketch mentioned in #775072: Add 'edit webforms' permission for attached webforms this fix bypasses node access so when using this module together with ie Organic allows for users with the new permission to edit all webforms.
I've added extra code in the other zip (http://drupal.org/files/webform_extra_permissions-D7-extra.zip) which test for 'update' permissions thus mitigates the Organic Group I hope. This needs testing.
I hope @quicksketch can shed a light on this too.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedThe workaround here worked perfectly for me (removed the webform tab, and if they try to navigate straight to the webform URL they get "You are not authorized to access this page."): http://drupal.org/node/775072#comment-3197810
Comment #13
mario.awad CreditAttribution: mario.awad commentedThe D7 module by @clemens.tolboom in comment #11 works well. No Organic Groups need so I couldn't test with that.
Question is, how do we make this awesome tiny module a proper contrib one so that we can update it in the future and our Drupal websites get its updates automatically?
I'm ready to help or even create the module, though I'm a beginner on this front.
Thanks.
Comment #14
Sting Hack CreditAttribution: Sting Hack commentedComment #15
Sting Hack CreditAttribution: Sting Hack as a volunteer and commented