Thank you very much for integrating Views into Webform 4.X. It opens up vast opportunties to manage submissions.
I used it to create a view that displays a submission a little fancier without the breaks and data I don't want others to see. I can still use the "raw" submission for administrator purposes.
The challenge was getting it so a user could not access to the regular submission View. After spending a day trying to use Webform Rules and Panels to unsuccessfully set up a redirect (submissions not being nodes makes this a challenge), I resorted to the simpler solution of removing the permission of "Access own webform submissions" from the users.
This unfortunately prevented them from editing or deleting their submissions. This I discovered was because the webform_submission_access function (line 586) requires $general_access to 'edit' and 'delete'. $general_access needs the "Access own webform submissions" permission to return true for basic users.
I removed this requirement from the case statements and I got my Edit and Delete tabs back both in the view links I created and the standard tabs. All without the View tabs and access so the user cannot get to the raw submission view.
I hate to alter the code of such a great module, but it seemed my only option. My question is what was the reasoning not to permit edit and delete unless a user had access permission too? I am concerned I may be setting myself up for potential disaster by changing the access logic.
Comments
Comment #1
danchadwick commentedIt would seem that if you leave the permission to access their own submissions and instead use hook_menu_alter to change the access function for the view tab to something of your liking, that you would be all set. You could probably leave the access as it is and change the page callback to something that displays (for admins) the normal view page or (for others) your limited views.
If this doesn't work, feel free to change this back to a feature request and re-open.
Comment #2
danchadwick commented