authorizationModelIdidentifierrequiredWhat identifies the model, made by the application
Becomes the column authorization_model_id of authorization_model.
Written at commons/data/models/identity-rebac/mod.ts:20
The definition of a relationship-based access model: its object types, relations, rewrites and caveats
Model identityRebac. Written in commons/data/models/identity-rebac/mod.ts:17. Identified by authorizationModelId.
authorizationModelIdidentifierrequiredWhat identifies the model, made by the application
Becomes the column authorization_model_id of authorization_model.
Written at commons/data/models/identity-rebac/mod.ts:20
definitionstructuredrequiredThe types, relations, rewrites and caveats
Becomes the column definition of authorization_model.
Written at commons/data/models/identity-rebac/mod.ts:18
statuscode of useStatusrequiredWhether it is in use
Becomes the column status of authorization_model.
Written at commons/data/models/identity-rebac/mod.ts:23
versionintegerrequiredWhich version of the model this is
Becomes the column version of authorization_model.
Written at commons/data/models/identity-rebac/mod.ts:21
tenantoptionalThe tenant it is for; empty for the platform's To tenant. Written at commons/data/models/identity-rebac/mod.ts:17
Projects to the table authorization_model with the primary key authorization_model_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
authorization_model_id | text | false | attribute | authorizationModel.authorizationModelId |
definition | json | false | attribute | authorizationModel.definition |
status | text | false | attribute | authorizationModel.status |
tenant_id | text | true | reference | authorizationModel.tenant |
version | integer | false | attribute | authorizationModel.version |
CREATE TABLE IF NOT EXISTS "authorization_model" (
"authorization_model_id" VARCHAR NOT NULL PRIMARY KEY,
"version" INTEGER NOT NULL,
"definition" JSON NOT NULL,
"status" VARCHAR NOT NULL,
"tenant_id" VARCHAR,
CONSTRAINT "authorization_model_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "authorization_model_status_ck" CHECK ("status" IN ('active', 'retired'))
);CREATE TABLE IF NOT EXISTS "authorization_model" (
"authorization_model_id" TEXT NOT NULL PRIMARY KEY,
"version" INTEGER NOT NULL,
"definition" JSONB NOT NULL,
"status" TEXT NOT NULL,
"tenant_id" TEXT,
CONSTRAINT "authorization_model_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "authorization_model_status_ck" CHECK ("status" IN ('active', 'retired'))
);CREATE TABLE IF NOT EXISTS "authorization_model" (
"authorization_model_id" TEXT NOT NULL PRIMARY KEY,
"version" INTEGER NOT NULL,
"definition" TEXT NOT NULL,
"status" TEXT NOT NULL,
"tenant_id" TEXT,
CONSTRAINT "authorization_model_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "authorization_model_status_ck" CHECK ("status" IN ('active', 'retired'))
);Read and written from TypeScript with the types the model gives: import { authorizationModel } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-rebac.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { authorizationModel } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(authorizationModel).select((s) => ({ authorizationModelId: s.authorizationModel.authorizationModelId, version: s.authorizationModel.version })).run(runner);