Skip to content

fix(graphql): bypass RBAC + multi-tenancy when generating type schema#1457

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/graphql-schema-multitenancy
May 10, 2026
Merged

fix(graphql): bypass RBAC + multi-tenancy when generating type schema#1457
rubenvdlinde merged 1 commit into
developmentfrom
fix/graphql-schema-multitenancy

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

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

  • Verify field count grows: `{ __schema { queryType { fields { name } } } }` returns 307 fields after the fix (was 52).
  • Verify decidesk fields are exposed: `meeting`, `decision`, `actionItem`, `minutes`, `agendaItem`, `participant`, `motion` all present.
  • Verify `{ meeting { totalCount } }` resolves cleanly (returns 0 in admin's current org, but no errors — proving the resolver auth still applies correctly).
  • Confirm CI green.

Related

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.
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ 25baf5d

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.

@rubenvdlinde rubenvdlinde merged commit 375490a into development May 10, 2026
17 of 20 checks passed
@rubenvdlinde rubenvdlinde deleted the fix/graphql-schema-multitenancy branch May 10, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant