Repository navigation
feat(relations): read an object's tree along its declared parent property - #4656
Merged
Merged
Conversation
…erty
ObjectTreeService walks descendants, ancestors or both along the parent
property a schema already declares (x-openregister-hierarchy.parent, else
x-openregister-party.parentProperty), one query per level, with levels,
cycle protection, the declared depth, the requested depth and the node
cap, and the caller's read access on every node. Exposed as
GET /api/objects/{register}/{schema}/{id}/tree. Decision 250.
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ✅ | ||||
| test-l10n-parity | ✅ | ||||
| format | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| composer | ✅ | ✅ 173/173 | |||
| npm | ✅ | ✅ 648/648 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ✅ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ✅ 26212/26212 · 25 skipped | ||||
| Newman | ✅ 714/714 | ||||
| Playwright | ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development. |
||||
| Hydra gates | ✅ |
Quality workflow — 2026-10-15 18:42 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.
Decision 250: an organisation's parent/subsidiary tree is a generic OpenRegister relation, and apps read it the same way.
What this adds
ObjectTreeService::tree()returns the descendants, ancestors or both of one object along the parent property its schema already declares:x-openregister-hierarchy.parent, elsex-openregister-party.parentProperty. No new annotation. An organisation group uses the party declaration, so no access flows down the tree.fields.maxDepth, the requesteddepth, and the node cap (relationGraphMaxNodes).truncatedBysays which one stopped the walk (depth,caporunreadable), and is only set when there really is more.MagicMapper::filterReadableUuids(). An unreadable node is left out along with its subtree, and the walk up stops at the first unreadable ancestor. In-process callers that scope their own reads can pass_rbac: false.GET /api/objects/{register}/{schema}/{id}/tree?direction=descendants|ancestors|both&depth=&fields=a,b: the root is resolved throughObjectReadAccess, so an unreadable root gets a 404 and nothing is walked.object-tree-read: what a party organisation is in this fleet, the design, and REQ-OTR-001/002.Verified locally
ObjectTreeServiceTest(10 tests) uses a real organisation fragment that passes both save-time validators and covers levels, a cycle, the depth bound, the declared cap, the node cap, RBAC pruning down and up, and the hierarchy declaration.ObjectRelationsControllerTreeTest(4 tests). As a control, I switched off the RBAC filter and the two RBAC tests failed.--threads=1) 0.--no-coverage: 26,237 tests, 15 errors, all intests/Unit/Db/*SQLite-migration tests that need Nextcloud core (OC\DB\Schema\Table not loadable). That is environment, not this change.Follow-ups (other repos)
kvkCompanyneeds aparentCompanyproperty and anx-openregister-partyblock before any group shows live.PortalPartyTreeResolver.