governance.ROLESconstno test imports itconst ROLES: readonly ["owner", "operator", "auditor", "viewer"]What a person may be to a tenant.
The model of tenancy for a service provider (0002-tenancy FR-001, FR-002): parties (an operator and its clients), the principals who act for a party, and the grants that let a principal act on a client's tenant in a role, for a time. A client's own people are granted on their own tenant; an operator's people are granted on a client only through a live engagement between the two. What a role may do is data here, and nothing is allowed that no live grant gives.
import { ROLE_ACTIONS } from "./model.ts";
ROLE_ACTIONS.viewer; // ["read"]governance.ROLESconstno test imports itconst ROLES: readonly ["owner", "operator", "auditor", "viewer"]What a person may be to a tenant.
governance.Roletypeno test imports ittype Role = (typeof ROLES)[number];A role.
governance.ACTIONSconstno test imports itconst ACTIONS: readonly ["read", "record-evidence", "determine", "approve-change", "administer", "export"]What can be done to a tenant.
governance.Actiontypeno test imports ittype Action = (typeof ACTIONS)[number];An action.
governance.ROLE_ACTIONSconstno test imports itconst ROLE_ACTIONS: Readonly<Record<"auditor" | "operator" | "owner" | "viewer", readonly ("administer" | "approve-change" | "determine" | "export" | "read" | "record-evidence")[]>>What each role may do: the owner everything; the operator's staff work in the tenant but neither determine an objective, approve a change nor administer; an auditor reads and determines; a viewer reads.
governance.Partytypeno test imports ittype Party = { readonly id: string; readonly kind: "operator" | "client"; readonly name: string };A party: an operator (a service provider) or a client (an organization whose tenant it is).
governance.Principaltypeno test imports ittype Principal = { readonly id: string; readonly party: string };A person or service that acts for a party.
governance.Granttypeno test imports ittype Grant = { readonly principal: string; readonly tenant: string; readonly role: Role; readonly from: string; readonly until?: string };A grant of a role on a tenant (the client's id), from an instant until another (open where absent).
governance.Engagementtypeno test imports ittype Engagement = { readonly operator: string; readonly client: string; readonly from: string; readonly until?: string };An engagement: an operator serves a client, from an instant until another (open where absent).
governance.Modeltypeno test imports ittype Model = { readonly parties: readonly Party[]; readonly principals: readonly Principal[]; readonly engagements: readonly Engagement[]; readonly grants: readonly Grant[] };The whole model of one deployment.
ROLESconstconst ROLES: readonly ["owner", "operator", "auditor", "viewer"]What a person may be to a tenant.
Roletypeno test imports ittype Role = (typeof ROLES)[number];A role.
ACTIONSconstconst ACTIONS: readonly ["read", "record-evidence", "determine", "approve-change", "administer", "export"]What can be done to a tenant.
Actiontypeno test imports ittype Action = (typeof ACTIONS)[number];An action.
ROLE_ACTIONSconstconst ROLE_ACTIONS: Readonly<Record<"auditor" | "operator" | "owner" | "viewer", readonly ("administer" | "approve-change" | "determine" | "export" | "read" | "record-evidence")[]>>What each role may do: the owner everything; the operator's staff work in the tenant but neither determine an objective, approve a change nor administer; an auditor reads and determines; a viewer reads.
Partytypeno test imports ittype Party = { readonly id: string; readonly kind: "operator" | "client"; readonly name: string };A party: an operator (a service provider) or a client (an organization whose tenant it is).
Principaltypeno test imports ittype Principal = { readonly id: string; readonly party: string };A person or service that acts for a party.
Granttypeno test imports ittype Grant = { readonly principal: string; readonly tenant: string; readonly role: Role; readonly from: string; readonly until?: string };A grant of a role on a tenant (the client's id), from an instant until another (open where absent).
Engagementtypeno test imports ittype Engagement = { readonly operator: string; readonly client: string; readonly from: string; readonly until?: string };An engagement: an operator serves a client, from an instant until another (open where absent).
Modeltypetype Model = { readonly parties: readonly Party[]; readonly principals: readonly Principal[]; readonly engagements: readonly Engagement[]; readonly grants: readonly Grant[] };The whole model of one deployment.