IF Commons GitHub

roleInheritance

concept

A role that inherits another: whoever holds the senior role holds what the junior role holds

Model identityAccess. Written in commons/data/models/identity-access/concepts.ts:53. Identified by senior, junior.

Governance: attributes

Governance: relationships

juniorone

The role that is inherited To accessRole. Written at commons/data/models/identity-access/concepts.ts:53

seniorone

The role that inherits To accessRole. Written at commons/data/models/identity-access/concepts.ts:53

Logical: the table

Projects to the table role_inheritance with the primary key senior_access_role_role_id, junior_access_role_role_id.

ColumnTypeNullRoleFrom
junior_access_role_role_idtextfalsereferenceroleInheritance.junior
senior_access_role_role_idtextfalsereferenceroleInheritance.senior

Physical: SQL

CREATE TABLE IF NOT EXISTS "role_inheritance" (
    "senior_access_role_role_id" VARCHAR NOT NULL,
    "junior_access_role_role_id" VARCHAR NOT NULL,
    PRIMARY KEY ("senior_access_role_role_id", "junior_access_role_role_id"),
    CONSTRAINT "role_inheritance_senior_access_role_role_id_fk" FOREIGN KEY ("senior_access_role_role_id") REFERENCES "access_role" ("role_id"),
    CONSTRAINT "role_inheritance_junior_access_role_role_id_fk" FOREIGN KEY ("junior_access_role_role_id") REFERENCES "access_role" ("role_id"),
    CONSTRAINT "role_inheritance_role_not_its_own_junior_ck" CHECK ("senior_access_role_role_id" <> "junior_access_role_role_id")
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { roleInheritance } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-access.auto.ts: do not edit.

import { from } from "@intellectual-frontiers/data/sql/typed";
import { roleInheritance } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(roleInheritance).select((s) => ({ seniorAccessRoleRoleId: s.roleInheritance.seniorAccessRoleRoleId, juniorAccessRoleRoleId: s.roleInheritance.juniorAccessRoleRoleId })).run(runner);

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