BobaBoard / issues

BobaBoard issue tracking
2 stars 0 forks source link

Allow moderators to hard delete threads/contributions/comments #94

Open essential-randomness opened 2 years ago

essential-randomness commented 2 years ago

Description

What it says on the tin: moderators (or roles with the corresponding permission) should be able to delete threads, contributions or comments.

Note: this issue doesn't cover logging the deletion or displaying information about the deletion to users. This is about offering a soft delete option similar to the one I've been using straight from the database, but making it available beyond me.

Flow

  1. If the user has the corresponding permission, a "delete thread/contribution/comment" option is added to the dropdown menu of the corresponding entity.
  2. A popup is displayed to the user, asking to confirm the action.
  3. If the action is confirmed, a request for deletion is sent to the the server.

Implementation steps

  1. Implement hard deletion for threads
  2. Implement soft deletion for threads
  3. Do the same for contributions
  4. Do the same for comments

The following tasklist is an example of implementation steps for deleting threads. We'll likely need to open other issues for contributions and comments:

### Backend tasks
- [ ] Write OpenAPI definition for delete thread endpoint
- [ ] Add `delete_threads` (`delete_contributions`|`delete_comments`) permissions to the backend
- [ ] Add an endpoint to delete a thread
- [ ] Write SQL queries to hard delete thread on the backend
- [ ] Write tests for endpoint
- [ ] Gate deletion of a thread on correct permissions
### Frontend tasks
- [ ] Add delete button to the frontend 
- [ ] Add confirmation popup
- [ ] Send request to the backend

TODO: make a separate issue for soft delete

essential-randomness commented 1 year ago

Pending PR: https://github.com/BobaBoard/boba-backend/pull/136