IF Commons GitHub

accessRole

concept

A set of permissions that is granted together, and that may inherit those of other roles

Model identityAccess. Written in commons/data/models/identity-access/concepts.ts:35. Identified by roleId.

Governance: attributes

appliesTocode of principalKindmany

The kinds of principal that may hold it; people, machines and groups where none is said

Becomes the column applies_to of access_role.

Written at commons/data/models/identity-access/concepts.ts:43

definitiontextrequired

What a holder of the role does

Becomes the column definition of access_role.

Written at commons/data/models/identity-access/concepts.ts:36

isPrivilegedbooleanrequired

Whether it is a role that an agent may never hold, and that needs a time-boxed grant where privileged access is composed

Becomes the column is_privileged of access_role.

Written at commons/data/models/identity-access/concepts.ts:44

kindcode of roleKindrequired

Whether the platform or a tenant made it

Becomes the column kind of access_role.

Written at commons/data/models/identity-access/concepts.ts:41

nametextrequired

What the role is called

Becomes the column name of access_role.

Written at commons/data/models/identity-access/concepts.ts:40

roleIdidentifierrequired

What identifies the role, made by the application

Becomes the column role_id of access_role.

Written at commons/data/models/identity-access/concepts.ts:38

roleKeytextrequired

The role's short name, unique within its tenant

Becomes the column role_key of access_role.

Written at commons/data/models/identity-access/concepts.ts:39

statuscode of useStatusrequired

Whether the role is in use

Becomes the column status of access_role.

Written at commons/data/models/identity-access/concepts.ts:45

Governance: relationships

tenantoptional

The tenant that made the role; empty for a role of the platform, usable in every tenant To tenant. Written at commons/data/models/identity-access/concepts.ts:113

Logical: the table

Projects to the table access_role with the primary key role_id.

ColumnTypeNullRoleFrom
definitiontextfalseattributeaccessRole.definition
is_privilegedbooleanfalseattributeaccessRole.isPrivileged
kindtextfalseattributeaccessRole.kind
nametextfalseattributeaccessRole.name
role_idtextfalseattributeaccessRole.roleId
role_keytextfalseattributeaccessRole.roleKey
statustextfalseattributeaccessRole.status
tenant_idtexttruereferenceaccessRole.tenant

Physical: SQL

CREATE TABLE IF NOT EXISTS "access_role" (
    "role_id" VARCHAR NOT NULL PRIMARY KEY,
    "role_key" VARCHAR NOT NULL,
    "name" VARCHAR NOT NULL,
    "kind" VARCHAR NOT NULL,
    "definition" VARCHAR NOT NULL,
    "is_privileged" BOOLEAN NOT NULL,
    "status" VARCHAR NOT NULL,
    "tenant_id" VARCHAR,
    CONSTRAINT "access_role_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
    CONSTRAINT "access_role_tenant_id_role_key_uq" UNIQUE ("tenant_id", "role_key"),
    CONSTRAINT "access_role_kind_ck" CHECK ("kind" IN ('system', 'custom')),
    CONSTRAINT "access_role_status_ck" CHECK ("status" IN ('active', 'retired'))
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { accessRole } 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 { accessRole } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(accessRole).select((s) => ({ roleId: s.accessRole.roleId, roleKey: s.accessRole.roleKey })).run(runner);

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