Skip to content

Image delete button visible without permission #3697

@Mailstorm-ctrl

Description

@Mailstorm-ctrl

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions