fpdcc / document-search

Search and management interface for spatial documents at the Forest Preserves of Cook County.
2 stars 0 forks source link

Allow read/write users to delete documents #92

Closed xmedr closed 1 year ago

xmedr commented 1 year ago

Overview

When viewing a document's edit page, the delete button was only rendering if the user was staff. This allows users with the Read/Write group to also delete.

Closes #91

Testing Instructions

xmedr commented 1 year ago

Bah I neglected to actually test the button, rookie mistake. That's actually what was happening for me too.

I just tried explicitly giving that user the permission docsearch | book | Can delete book in the admin and that didn't work out. So I found the line where only staff is allowed to delete, and added read/write users. This works now for me, lmk if anything else comes up for you! https://github.com/fpdcc/document-search/blob/4ead565254d14a0052eb10ef63cd67834191ae1b/docsearch/views/base.py#L97-L101