Image delete button visible without permission #3082

Closed
opened 2026-02-05 06:01:51 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @Mailstorm-ctrl on GitHub (Sep 5, 2022).

Describe the Bug

This might be in other places but this bug is specifically for images.

If a user is allowed to VIEW pictures but NOT DELETE them the user will still have access to the delete button in the image select menu.
image

If I click on the confirm button, I will get a bugged view of the image select screen that is only temporary.
image

The image doesn't delete (good) but the button still shouldn't be visible. Just a minor QoL thing.

Steps to Reproduce

  1. Create a role that can view images but not delete them.
  2. Have a book where that role can view/create/edit but not delete.
  3. Upload an image to a page is said book.
  4. Save page.
  5. Open page and try to delete the image from the image select menu.
  6. Observe.

Expected Behaviour

Delete button to be not visible or at least not-clickable.

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

v22.07.3

PHP Version

No response

Hosting Environment

Ubuntu 20.04 LTS in a LXC container.

Originally created by @Mailstorm-ctrl on GitHub (Sep 5, 2022). ### Describe the Bug This might be in other places but this bug is specifically for images. If a user is allowed to VIEW pictures but NOT DELETE them the user will still have access to the delete button in the image select menu. ![image](https://user-images.githubusercontent.com/53045430/188467681-74970cce-c148-4016-8c2d-20d501c5ebc9.png) If I click on the confirm button, I will get a bugged view of the image select screen that is only temporary. ![image](https://user-images.githubusercontent.com/53045430/188467782-1e526085-a4fa-4a9b-a94a-976c7c29d4a5.png) The image doesn't delete (good) but the button still shouldn't be visible. Just a minor QoL thing. ### Steps to Reproduce 1. Create a role that can view images but not delete them. 2. Have a book where that role can view/create/edit but not delete. 3. Upload an image to a page is said book. 4. Save page. 5. Open page and try to delete the image from the image select menu. 6. Observe. ### Expected Behaviour Delete button to be not visible or at least not-clickable. ### Screenshots or Additional Context _No response_ ### Browser Details _No response_ ### Exact BookStack Version v22.07.3 ### PHP Version _No response_ ### Hosting Environment Ubuntu 20.04 LTS in a LXC container.
OVERLORD added the 🐛 Bug🏭 Back-End labels 2026-02-05 06:01:51 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3082