Issue Feature Under Review

#111328Decide page permissions with a security voter

Benni Mack 11/03/26, 11:30 updated 11/18/26, 19:16

Description

The page permissions of backend users are decided by BackendUserAuthentication only: the SQL clause of getPagePermsClause(), the webmount check of isInWebMount() and the permission bitmask of calcPerms(). Voters of the authorization checker (#111235) cannot use them without the user object, and new APIs such as a record read check have to pass the user object around.

Proposal

  • An internal PagePermissionEvaluator decides page permissions for a context of the user, its groups and the mounts of the request. The three methods of BackendUserAuthentication delegate to it.
  • A PageVoter decides on Page objects for reading, updating, deleting, creating subpages and a new scope for changing the content of a page.
  • Webmounts and the workspace are no part of the principal. The backend stores them, together with the file mounts and storages (resolved on first access only), as mount context on the security token of the request.
  • The hooks getPagePermsClause and calcPerms are deprecated in favour of two PSR-14 events:
    • ModifyPagePermissionClauseEvent: listeners build constraints with an expression builder instead of SQL strings
    • ModifyPagePermissionsEvent: listeners grant or revoke permissions on a single page

The events apply to the voter and to the methods of BackendUserAuthentication alike, so that extensions such as access control lists keep working with both.

Reviews 2

History 012