#111646Record history scope lookup applies limit before permission check
Description
The record history can show all changes of one operation, optionally restricted to its latest entries. Only entries the current user may see are meant to be returned. The limit is to the database query (setMaxResults()) before entries the current user must not see (missing table or page permissions) are filtered out. As a result, a limited lookup can return fewer entries than requested, or none at all, although visible entries of that operation exist.
Steps to reproduce:
1. An operation (one correlation scope) writes history entries for a page the editor may see and, later, for a page the editor has no permission for.
2. As that editor, call findEventsForScope($scope, 1).
Expected: the latest entry the editor may see.
Actual: an empty array, as the only fetched entry is filtered out.
The core itself does not pass a limit (ElementHistoryController), so this affects extensions using the method.
Reviews 1
History 01
-
Gerrit Code Review pushed patch set 1 for main to change 98133 status
NewUnder Review 11/28/26, 05:45