Skip to content

Updating reports-to,oversees relationship logic to better support Secretariat users. - #1949

Closed
jdalphond-mitre wants to merge 10 commits into
devfrom
jd_1933
Closed

Updating reports-to,oversees relationship logic to better support Secretariat users.#1949
jdalphond-mitre wants to merge 10 commits into
devfrom
jd_1933

Conversation

@jdalphond-mitre

Copy link
Copy Markdown
Collaborator

Resolves issue #1933 , add dedicated Secretariat endpoints for managing ROOT organization reports-to relationships.

Closes Issue #1933

Summary

Adds a supported, auditable way for Secretariat users to assign and remove an organization’s ROOT reports-to relationship.

Important Changes

src/controller/registry.controller/index.js

  • Adds Secretariat-only POST endpoints to add and remove oversees relationships.
  • Documents both endpoints in OpenAPI.

src/controller/registry.controller/org.registry.controller.js

  • Validates that the overseeing organization has ROOT authority.
  • Handles relationship creation and removal in a transaction.
  • Prevents standard organization PUT requests from updating oversees.

src/repositories/baseOrgRepository.js

  • Adds repository methods to assign and remove relationships.
  • Removes a reporting organization from any previous ROOT parent during reassignment.
  • Creates audit entries for affected ROOT organizations.

src/controller/registry.controller/org.error.js

  • Adds an error response for attempts to assign a non-ROOT overseeing organization.

test/integration-tests/registry-org/rootOrgTest.js

  • Covers assignment, reassignment, removal, invalid ROOT authority, missing organizations, and authorization.

test/integration-tests/registry-org/registryOrgCRUDTest.js

  • Verifies standard PUT requests cannot create oversees or derived reports_to relationships.

Testing

  • 1) Run the registry organization integration test suite.
  • 2) As a Secretariat user, assign a reporting organization to a ROOT organization and confirm reports_to is returned.
  • 3) Reassign that organization to a different ROOT organization and confirm the prior relationship is removed.
  • 4) Remove the relationship and confirm reports_to is no longer returned.
  • 5) Verify ROOT admins cannot manage relationships or modify oversees through the standard PUT endpoint.

Notes

Relationship management is intentionally restricted to the dedicated Secretariat endpoints; standard organization updates ignore the oversees field.

ChenyangLi4288 and others added 10 commits July 13, 2026 11:40
Add optional projection parameters to OrgRepository.getAllOrgs and
UserRepository.getAllUsers so callers can limit returned fields.
getFilteredCveId now fetches only UUID and short_name for orgs, and
UUID, username, and org_UUID for users, instead of entire documents.
…e-id-filter

 Resolves issue #1843, Use field projections in getFilteredCveId.
Closes #1928: Remove legacy registry=true support
Add Secretariat-only endpoints for assigning and removing an
organization’s reports-to relationship with a ROOT organization.

- Add documented POST endpoints to add and remove ROOT `oversees`
  relationships.
- Validate that the overseeing organization has ROOT authority and return
  clear errors when either organization is not found.
- Reassign a reporting organization atomically by removing it from a
  previous ROOT organization before adding the new relationship.
- Audit additions, removals, and reassignments for every affected ROOT
  organization.
- Ignore `oversees` in standard organization PUT requests so reports-to
  relationships can only be managed through the dedicated endpoints.
- Update existing CRUD coverage to verify PUT requests cannot create
  `oversees` or derived `reports_to` relationships.
- Add ROOT organization integration coverage for successful assignment,
  reassignment, removal, invalid non-ROOT parents, missing organizations,
  and Secretariat-only authorization.
@jdalphond-mitre jdalphond-mitre changed the title Jd 1933 Updating reports-to,oversees relationship logic to better support Secretariat users. Jul 29, 2026
Comment thread src/controller/registry.controller/index.js Dismissed
Comment thread src/controller/registry.controller/index.js Dismissed
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.

4 participants