fix(graphql): bypass RBAC + multi-tenancy when generating type schema#1457
Merged
Conversation
Fixes #1456. SchemaGenerator was calling RegisterMapper::findAll() and SchemaMapper::findAll() with default args, which apply the caller's active-organisation filter. That made the generated GraphQL schema org-scoped (per-request, then APCu-cached), silently hiding every cross-org schema from the type system even though those schemas are readable via REST under the same session. GraphQL schema generation is system-scoped. Per-user authorisation should happen at resolve time on each query, not at type-generation time. Bypass both flags here, mirroring the same fix we applied in PermissionHandler::resolveSchemaSlug for #1454.
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ❌ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ✅ | ||||
| composer | ✅ | ❌ 1/153 denied | |||
| npm | ✅ | ✅ 598/598 | |||
| PHPUnit | ⏭️ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
❌ Denied composer licenses
| Package | Version | License |
|---|---|---|
| dompdf/dompdf | v3.1.5 | LGPL-2.1 |
Quality workflow — 2026-05-10 12:26 UTC
Download the full PDF report from the workflow artifacts.
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.
Summary
GraphQL schema generation was org-scoped (silently): `SchemaGenerator::generate` called `SchemaMapper::findAll()` / `RegisterMapper::findAll()` with default args, which apply multi-tenancy filtering. The generated GraphQL type schema therefore varied per active org and hid every cross-org schema from `__schema` introspection — even though those schemas are readable via REST under the same session.
Bypass RBAC + MT during type generation; per-user authorisation already happens at resolve time on each query.
Why
Same root cause as #1454 (PermissionHandler had the same RBAC issue). Surfaced while wiring the `@conduction/nextcloud-vue` library's `stats-block` widget — which queries OR's GraphQL for aggregated counts. With this fix, all 307 (vs prior 26) schemas are introspectable.
Closes #1456.
Test plan
Related