Skip to content

fix: tighten permission checks in mediapool media list - #6614

Merged
gharlan merged 3 commits into
5.xfrom
fix-mp-bulk-move
Aug 3, 2026
Merged

fix: tighten permission checks in mediapool media list#6614
gharlan merged 3 commits into
5.xfrom
fix-mp-bulk-move

Conversation

@gharlan

@gharlan gharlan commented Aug 3, 2026

Copy link
Copy Markdown
Member

Tightens the permission checks in the mediapool media list and fixes a message key that did not exist.

Details are intentionally brief here — the relevant parts are only mentioned in the commit messages for now and will be described properly once released.

gharlan added 2 commits August 3, 2026 15:09
The mediapool referenced a `no_permission` key that is not defined in any
lang file, so the permission errors of the bulk delete and of the media
detail page rendered as `[translate:no_permission]`.

Use the existing `no_rights_to_this_function` message instead and move it
from the structure/content plugin to core, including all translations, so
it no longer depends on that plugin being available.
The bulk move only checked whether the user has permission for the target
category. The file itself was addressed by its filename and its category
assignment was overwritten without verifying where the file came from, so
write permission on any single category was enough to pull arbitrary
files out of categories that are blocked for the user. Once moved, all
further access controls apply to the now permitted target category.

Load the media object and require permission for its source category as
well, mirroring the bulk delete right below, and skip files that fail the
check. Errors and success messages are collected per file, so a partially
permitted selection no longer reports only the outcome of the last file.

The list also offered checkboxes for media the user has no permission
for: media permissions are flat, while the search filters by category
path (or not at all, in global search mode), so files from subcategories
showed up as selectable. Render the checkbox only when the user has
permission for the media's own category, which covers the bulk delete as
well.
@rex-bot rex-bot added the bug label Aug 3, 2026
@gharlan gharlan added this to the REDAXO 5.21.4 milestone Aug 3, 2026
@gharlan
gharlan merged commit 7bb8567 into 5.x Aug 3, 2026
18 checks passed
@gharlan
gharlan deleted the fix-mp-bulk-move branch August 3, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants