Skip to content

[6.x] Fix entry revision localizations to filter unauthorized sites#14714

Open
duncanmcclean wants to merge 1 commit into
6.xfrom
fix/entry-revision-localizations-authorization
Open

[6.x] Fix entry revision localizations to filter unauthorized sites#14714
duncanmcclean wants to merge 1 commit into
6.xfrom
fix/entry-revision-localizations-authorization

Conversation

@duncanmcclean
Copy link
Copy Markdown
Member

This pull request fixes an issue where the entry revision preview endpoint exposed all collection sites in the localizations array, regardless of user permissions. This allowed users with restricted site access to view site details they shouldn't have access to.

This was happening because EntryRevisionsController::show() was building the localizations list directly from $entry->collection()->sites() without applying authorization checks.

This PR fixes it by adding the getAuthorizedSitesForCollection() method (matching the pattern already used in EntriesController) to filter sites based on whether the current user can view each site.

Fixes #14697

The revision preview endpoint was exposing all collection sites
in the localizations array regardless of user permissions. This
allowed users with restricted site access to view unauthorized
site details in the API response.

Apply the same authorization filtering used in EntriesController
by adding getAuthorizedSitesForCollection() to filter sites based
on the current user's view permissions.

Fixes #14697

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@duncanmcclean duncanmcclean force-pushed the fix/entry-revision-localizations-authorization branch from b9467f5 to da7ace0 Compare May 22, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Entry revision localizations include unauthorized sites

1 participant