Lots of people are asking for finer control over who can see results for forms. Right now the only way (as far as I know) is to allow access to ALL results or just results of your OWN webform.
RIght now, I build forms for my users, and then assign authorship to the one person who needs to see the results, and set all users' permissions to see OWN webform results. I also use "NodeAccess" to prohibit editing OWN nodes for the webform content type. This way, people don't edit and screw up the webforms they are in charge of.
This works great, except that I can't have multiple authors, so only two people can see the webform results: superadmin, and the author.
Somehow allowing multiple authors would fix this problem and make everyone happy because the code would not need to be changed at all.
I have explored a few options for multiple authors. The modules "Coherent Access" and "Author Taxonomy" both create new fields for authorship and webforms does not respect their idea of a node's author.
Does anyone know of a way to *legitimately* enable multiple authors for a node? Otherwise, is there a way to change the code of webforms to respect either of those two modules' designation of author?
Lastly, perhaps I am mistaken, and there IS a way to allow node-level access to webform results to individual users (not just ALL or OWN). If so, please let me know. Thanks for reading.
Comments
Comment #1
quicksketchI think the most logical way to approach this would be for Webform to provide a hook to check submission viewing and editing access. Then those other modules could implement the hook and provide ownership based on the way they define multiple authors, or through any other system that was created to allow/deny access to viewing or editing submissions. Webform would implement it's own hook for submission access to provide the current functionality of view and edit access based on the current permissions.
Comment #2
bbeyer commentedsubscribe
Comment #3
Ellen Dee commentedsubscribe
Comment #4
quicksketchThis is fixed already now. The necessary hooks all exist. See http://drupal.org/project/og_webform for an example of implementing a solution like this.
Comment #6
mforbes commentedI know this is an ancient thread (and is categorized under D6 whereas I'm on D7), but it is a very prominent result for a search such as https://www.google.com/search?q=webform+results+viewer+per+node which is why I figured I'll continue the conversation right here:
I have familiarized myself with the relevant hooks described in #4 (in fact, I implemented them in a sort of
if (drupal_valid_path("node/$nid/edit") return true;sort of way since that met a particular need in the past) and I have also considered og_webform, but that's not exactly what I need now either. Those two approaches assume that the set of people who need access to a particular node's submissions are a set that is already a well-defined group... a group that will likely be reused for other things.But I've found that -- much like the original report here, I think -- the set of people who need access to a particular node's submissions are not a group having any other purpose whatsoever. Rather, I'd like a stupid-simple way for the node's editor(s) to add/remove submission viewers on a per-node basis.
Unless there is a contrib module that already does this sort of thing, my plan is to add an entityreference field called "Results Access" to my webform-enabled content types, set it for a User reference with unlimited cardinality, and then implement the relevant hooks to grant submission view access to any users referenced in that field (per node).
So... does this already exist, or should I go ahead and build as described? Maybe I'll make it a lightweight contrib module if I do...