-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
Ticket: Restrict Organization Creation/Request to Secretariat Only
Description
Currently, authenticated users can request the creation of a new organization via POST /registryOrg. This triggers a "Review Org" workflow where a ReviewObject is created for the Secretariat to approve.
We need to remove this capability. Only the Secretariat should be able to create new organizations directly. The "Request New Organization" workflow for non-Secretariat users should be disabled.
Acceptance Criteria / TODOs
Backend Changes (src/controller/registry-org.controller/index.js)
- Update Route Middleware:
- Add
mw.onlySecretariatto thePOST /registryOrgroute definition. - Existing chain is:
mw.useRegistry(), mw.validateUser, parseError, parsePostParams, controller.CREATE_ORG. - New chain should include
mw.onlySecretariatafter validation.
- Add
Backend Changes (src/controller/registry-org.controller/registry-org.controller.js)
- Simplify createOrg Controller:
- Remove the logic that handles non-Secretariat requests (the
elseblock that createscreate_review_orgpayload). - Remove the check
if (isSecretariat)since the middleware will guarantee it. - Ensure the function assumes authoritative creation (upserting/creating the Org directly).
- Remove the logic that handles non-Secretariat requests (the
Documentation Changes
- Update Swagger Comments:
- Ensure
POST /registryOrgclearly states "Secretariat Only". - Remove any "Expected Behavior" describing "User requests a new org".
- Ensure
Testing
- Integration Test:
- Verify that a Secretariat user can create an organization.
- Verify that a non-Secretariat user receives a 403 Forbidden when trying to POST to
/registryOrg.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Needs Triage
Status
In Review