IF Commons GitHub

authorizationModel

concept

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.

Governance: attributes

authorizationModelIdidentifierrequired

What 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

definitionstructuredrequired

The types, relations, rewrites and caveats

Becomes the column definition of authorization_model.

Written at commons/data/models/identity-rebac/mod.ts:18

statuscode of useStatusrequired

Whether it is in use

Becomes the column status of authorization_model.

Written at commons/data/models/identity-rebac/mod.ts:23

versionintegerrequired

Which version of the model this is

Becomes the column version of authorization_model.

Written at commons/data/models/identity-rebac/mod.ts:21

Governance: relationships

tenantoptional

The tenant it is for; empty for the platform's To tenant. Written at commons/data/models/identity-rebac/mod.ts:17

Logical: the table

Projects to the table authorization_model with the primary key authorization_model_id.

ColumnTypeNullRoleFrom
authorization_model_idtextfalseattributeauthorizationModel.authorizationModelId
definitionjsonfalseattributeauthorizationModel.definition
statustextfalseattributeauthorizationModel.status
tenant_idtexttruereferenceauthorizationModel.tenant
versionintegerfalseattributeauthorizationModel.version

Physical: SQL

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'))
);

Physical: the typed table

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);

Titles, headings, exports, tables, columns and requirements. Esc closes.