Skip to content

feat(organisations): multi-tenancy resources and ownership fields - #31

Draft
camreeves wants to merge 2 commits into
masterfrom
PPT-526-tenancy
Draft

camreeves wants to merge 2 commits into
masterfrom
PPT-526-tenancy

Conversation

@camreeves

Copy link
Copy Markdown
Contributor

SDK half of multi-tenancy (PPT-2702, under PPT-526). Pairs with PlaceOS/rest-api#451 and PlaceOS/models#332. Draft until the set has been through the test cluster; merging publishes to npm.

What this adds

  • organisations, partners and grants modules with the usual query, show, add, update and remove calls.
  • currentReach() for GET /organisations/current: the caller's reach (cluster, partner or organisation), whether the API is enforcing, their own organisation and partner, and the organisations in reach. Backoffice reads this once at login.
  • claimZonesForOrganisation(id, zone_ids) for adopting unowned zone trees.
  • organisation_id on PlaceDomain, PlaceZone, PlaceSystem, PlaceModule, PlaceTrigger, PlaceEdge and PlaceMQTTBroker.
  • organisation_id query option on the zone, system, module, trigger and user index calls.
  • An optional owner option on addDomain, addZone, addModule and updateDomain (cluster admins naming the organisation). Existing call signatures are unchanged.

Verification

  • tsc clean, vitest 604 tests across 76 files pass, vite build ok.
  • The repo's eslint . script fails to start on this ESLint version because the config is in the legacy format; that is unchanged by this branch.

Plan: https://gist.github.com/camreeves/3fabfff92bcdef77a1dcb4b8d8ebfe7b

Adds organisations, partners and grants modules, currentReach for the
caller's reach, claimZonesForOrganisation, an organisation_id field on
domains, zones, systems, modules, triggers, edges and brokers, an
organisation_id query option on their index calls, and an organisation
owner option when creating domains, zones and modules.

This branch has not been deployed

No deployments
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