I am running Drupal v8.5.14 and I'm trying to give users with a specific role the ability to delete multiple submissions at once by using checkboxes from the form's Results/Submissions page. I have tried quite a number of different things, and I have watched through the Webform Views Integration video (https://www.youtube.com/watch?v=Qs_m5ybxeXk) as well as read through this similar topic (https://www.drupal.org/project/webform/issues/1589582) but have not found a solution. I feel like I can't be the only one who has had this issue but I don't know where else to go for help and I feel I've exhausted all my options in terms of settings and configurations I've tried.

I'll try to explain my specific issue as clearly as possible, and I have attached screenshots in case they are helpful:

- All I want is for users with a specific role (called Form Admins) to be able to bulk delete/delete multiple submissions at once
- In the form's Access settings, I have granted this Form Admins role access to the "Administer Webform & Submissions" flag so they have full permissions to all submissions for this form
- I have created a custom Webform View called Bulk Delete View that includes checkboxes to select multiple submissions (screenshot 1)
- I have set my custom Bulk Delete View's Access settings to None (screenshot 2)
- I have added my custom Bulk Delete View to this form's Submission Views under the form's Settings/Submissions (screenshot 3)
- When using my custom Bulk Delete View, Form Admins role users can see and use the checkboxes (screenshot 4)
- Currently, Form Admins role users can delete individual submissions one at a time, but receive an Access Denied error message when trying to use the Bulk Delete View I've created with checkboxes (screenshot 5)

What is really confusing me is that these users can delete individual submissions (which makes me think it's not a form access issue) but get an Access Denied error message when using the custom Bulk Delete View I've created - and that even with my full Administrator account, I get the same Access Denied error message when trying to use the same View to delete multiple submissions.

Since Form Admins role users can successfully delete individual submissions, but even full Administrator users cannot perform the Delete action when multiple submissions are selected using this view, it makes me think the issue is related to the View permissions...but how is this possible if I've set the View/Access to None?

I am totally stumped on this and would greatly appreciate any assistance! If you need any additional information or screenshots just let me know!

Comments

thefalloftroy created an issue. See original summary.

jcontreras’s picture

Status: Active » Needs review
StatusFileSize
new447 bytes

The access denied has to do with the wrong access permission(I assume) in the router. I created this patch I hope it works for you.

Status: Needs review » Needs work
jrockowitz’s picture

I think the patch is moving the right direction and it is possible that the broken tests only need some minor tweaks.

jcontreras’s picture

Version: 8.x-5.1 » 8.x-5.x-dev
StatusFileSize
new449 bytes

>>>>>>>>> DON'T USE THIS PATCH, USE PATCH ON #6 INSTEAD <<<<<<<<<
I just realized I used the submission edit permission and not the delete permission on that last patch. Here is the revised patch.

@jrockowitz - The previous error comes from "webform/tests/src/Functional/Views/WebformViewsBulkFormTest.php:91"

line 01 - $this->drupalPostForm(NULL, [], t('Delete')); <-- is that supposed to be there?

jcontreras’s picture

Again something wrong with patch 3 on #5 - use this patch instead.

jrockowitz’s picture

$this->drupalPostForm(NULL, [], t('Delete')); submits the previosly loaded form.

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new1.1 KB

  • jrockowitz authored db60502 on 8.x-5.x
    Issue #3114644 by jcontreras, jrockowitz, thefalloftroy: Webform View...
jrockowitz’s picture

Status: Needs review » Fixed

  • jrockowitz authored db60502 on 6.x
    Issue #3114644 by jcontreras, jrockowitz, thefalloftroy: Webform View...

Status: Fixed » Closed (fixed)

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