Forum

Thread tagged as: Problem

Form permission issue

I think this might've been lost as it's an old-fish thread. I've updated my CMS and Forms app after last week's release and this is still an issue https://forum.grabaperch.com/forum/10-09-2017-issue-deleting-forms

Not sure if it's my fault that I'm not configuring something right or if it's due for a different release.

Thanks for taking a look,

Martin.

Martin Underhill

Martin Underhill 5 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It's definitely there - the privilege is perch_forms.delete

Hi Drew,

I can't seem to get it working. This is what the setup in Roles looks like: https://www.dropbox.com/s/bh5wh7p2hro2gse/Screen%20Shot%202017-11-21%20at%204.38.43%20pm.png?dl=0

I've double checked my test user has the right role. I've also saved the role again, in case it was a cacheing issue.

It looks like I can delete the whole set of form responses from the initial 'Listing forms' page (this was the case before this update too): https://www.dropbox.com/s/om1tdzudpkefsz9/Screen%20Shot%202017-11-21%20at%204.35.19%20pm.png?dl=0

But once I'm in the set of form responses I can see the 'Responses', 'Date' and 'Detail' columns but no delete button on the right of each response: https://www.dropbox.com/s/wnrx2yymn9udrb7/Screen%20Shot%202017-11-21%20at%204.35.28%20pm.png?dl=0

Sounds like I'm doing something wrong…

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, I'll have to take a look at it next time Forms is updated.

Thanks Drew. Do you have any idea on roughly when It'll be? I'm deleting forms for them in the interim and there are hundreds of records each week :'(

Would you steer me away from doing it directly in the database? That would be quicker…

Drew McLellan

Drew McLellan 2638 points
Perch Support

How often do you need to delete forms? Surely you only get a new form when one is added to the site?

Oh, I think I might've communicated this badly… Sorry! So it's the form submissions received by my client that they need to clear down. They receive lots of form submissions each day from various clients (through a Member's area) and like to keep things tidy by deleting old emails they don't need any more.

This is kind of an aside, but you might be wondering why they don't just operate via their email client. Their clients send them files via the forms, which is why they clear them down, so that Perch then removes them from the server. They're not allowed to receive the files via email (they say "it’s a breach of data security i.e. sample to our inboxes and it also circumvents the secure log in of the site") so the only way to get the forms is through the CMS. (I comment out $Email->attachFile($File->name, $File->path, $File->mime); on line 272 of the Forms app with each update.)

Hope that explains things better. I'm a nightmare for assuming people know what's going on in my head, even though they'd have no way of knowing that context. Let me know if all that makes sense :)

Simon Clay

Simon Clay 127 points

Hi Drew, just to echo what Martin is experiencing, I too find that an Editor Role with all permissions switched on cannot delete form submissions. Perch: 3.0.11

Simon Clay

Simon Clay 127 points

Just to add to my comment. I find that it works as expected on a fresh Perch 3 install. But not on the upgraded version.

Role options on fresh install are:

  • Access forms
  • Configure forms
  • Delete forms
  • Delete responses
  • Export responses

Whereas Role options on the updated site are:

  • Access forms
  • Configure forms
  • Delete forms
  • Export responses
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, well if you want to patch your install, add this to a page that includes the Perch runtime and load it. You can then remove the code.

    $API = new PerchAPI(1.0, 'perch_forms');
    $UserPrivileges = $API->get('UserPrivileges');
    $UserPrivileges->create_privilege('perch_forms', 'Access forms');
    $UserPrivileges->create_privilege('perch_forms.configure', 'Configure forms');
    $UserPrivileges->create_privilege('perch_forms.delete', 'Delete forms');
    $UserPrivileges->create_privilege('perch_forms.delete_responses', 'Delete responses');
    $UserPrivileges->create_privilege('perch_forms.export', 'Export responses');

Hi Drew, that has fixed the issue :) Thank you!