Many websites display the total submission count of webforms to anonymous users to show the level of support for their campaigns (change.org, kickstarter, etc). Webform is well suited for these kinds of forms except that the submission_count field that is available within views is tied to the same permission that accesses individual submission items.

I propose adding a new role-based permission to "Access webform submissions count" so that site builders can display this data to anonymous users without resorting to hacks, of which there are several in the past looking for similar functionality from webform.

Committed to 7.x-4.x and 8.x

Comments

  • DanChadwick committed 4bcc0b0 on 7.x-4.x
    Issue #2367065 by DanChadwick: Output a total submission count in views...
  • DanChadwick committed 750d153 on 8.x-4.x
    Issue #2367065 by DanChadwick: Output a total submission count in views...
danchadwick’s picture

Title: Add a role-based permission for submission count » Output submission count without link when unauthorized to see submissions/results
Issue summary: View changes
Status: Active » Fixed
StatusFileSize
new1.29 KB

What are the "hacks" to which you refer?

I just looked at the views submission count handler (webform_handler_field_submission_count), and when used for a webform node, it returns a count which is a link:

  1. If the user has access to all the results, then the count is of all the results and the link is to the results tab.
  2. Otherwise it returns the number of submissions for the current user and a link to the submission page.

I don't think for anonymous users you want either of these.

Instead, if the user has neither access to all the result nor access to the list of their own submissions, the a count of all the results (with no links) should be returned. Note that this is a VERY SLIGHT difference in security. The total number of submissions would be exposed now in a situation where it previously a non-functional link with a count of the anonymous submissions would have been given.

mducharme’s picture

Here are two examples:
http://drupal.stackexchange.com/questions/57105/webform-submission-count...
https://www.drupal.org/node/1905924

Thanks for the quick patch. I'll test this out later today.

danchadwick’s picture

Thanks. I posted to those two places. Remember to make sure that the dev build has the patch. It can take a few hours.

Status: Fixed » Closed (fixed)

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