fix(rbac): NC-32 IResult lacks fetchAllAssociative() → RBAC fail-closes every internal read#2035
Merged
rubenvdlinde merged 1 commit intoJul 22, 2026
Conversation
…ses every internal read RegisterMapper::getAllRegisterIdsWithSchema() and SettingsController's diagnostic query called Doctrine's fetchAllAssociative() on Nextcloud's IResult (OC\DB\ResultAdapter), which does not expose that method on every supported server — it is absent on NC 32 and throws 'Call to undefined method'. getAllRegisterIdsWithSchema() runs inside PermissionHandler's authorization resolver (getRegisterForSchema); its catch re-throws as AuthorizationUnresolvableException and FAIL-CLOSES the action. The net effect on NC 32: every RBAC-checked read via ObjectService::find() — dashboard widgets, the status-transition engine (available-transitions → current status never resolves), single-object reads — is denied even for admin, while the list path (which uses findMultipleOptimized, no per-row resolver) still works, masking the cause. Iterate fetch() instead, matching the fix already applied in MarkerLookupTrait. Verified on a live NC-32 instance: available-transitions now resolves the status name and procest dashboard widgets return 200 instead of 403. DbalObjectSourceProvider's fetchAllAssociative() calls are left as-is — those run against an external raw \Doctrine\DBAL\Query\QueryBuilder whose Result does expose the method.
rubenvdlinde
deleted the
fix/nc32-iresult-fetchallassociative-rbac-failclose
branch
July 22, 2026 22:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Nextcloud 32,
OC\DB\ResultAdapter(whatIQueryBuilder::executeQuery()returns) does not expose Doctrine'sfetchAllAssociative()— calling it throwsCall to undefined method.RegisterMapper::getAllRegisterIdsWithSchema()used it, and that method runs insidePermissionHandler's authorization resolver (getRegisterForSchema()). Itscatchre-throws asAuthorizationUnresolvableException, which fail-closes the action.Net effect on NC 32: every RBAC-checked read via
ObjectService::find()is denied even for admin — dashboard widgets (403), the status-transition engine (available-transitions→ current status never resolves), and single-object reads. The list path still works (it usesfindMultipleOptimized, no per-row resolver), which masks the root cause: the register lists data but every detail/aggregate read 403s.Fix
Iterate
fetch()instead offetchAllAssociative(), matching the pattern already applied inMarkerLookupTrait. Two sites:lib/Db/RegisterMapper.php—getAllRegisterIdsWithSchema()(the RBAC-critical one)lib/Controller/SettingsController.php— a diagnostic query (same NC-32 bug)DbalObjectSourceProvider'sfetchAllAssociative()calls are intentionally left — those run against an external raw\Doctrine\DBAL\Query\QueryBuilderwhoseResultdoes expose the method.Verification
Reproduced + fixed on a live NC-32 instance (procest + OpenRegister). Before:
available-transitionsreturnedcurrent: []andloadCase failed / Unable to resolve register for schema N; procest dashboard widgets 403. After:current: {statusId, statusName}resolves and the widgets return 200. Surfaced while running procest's live-NC Playwright e2e suite against NC 32.🤖 Generated with Claude Code