Issue Bug Closed

#110380bypassAccessCheckForRecords no longer works when the backend user has no uid

Sebastian Michaelsen 08/05/26, 19:18 updated 08/05/26, 21:29

Description

Since 14.3.5 and 13.4.33, DataHandler denies every permission check when the backend user object has no uid, before bypassAccessCheckForRecords is evaluated. This breaks “system” DataHandler usages that pass a backend user not backed by a be_users record, while the property still documents the opposite: “If TRUE, access check, check for deleted etc. for records is bypassed.”

Cause

hasPageContextPermission(), introduced by #107432:

$beUserUid = $this->BE_USER->getUserId();
if (!$beUserUid) {
return false; // <— reached first
}
if ($this->bypassAccessCheckForRecords || $this->BE_USER->isAdmin()) {
return true;
}

In 14.3.4 the same guards sat in hasPagePermission() in the opposite order: bypass/admin first, uid check only reached for regular users. That change is about root-level restrictions and doesn’t mention the reordering, so i assume it is unintended collateral.

Suggested fix : move the uid guard back below the bypass/admin short-circuit. If requiring a real uid is intended, it should be documented as a breaking change.

Reviews 1