appliesTocode of principalKindmanyThe 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
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.
appliesTocode of principalKindmanyThe 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
definitiontextrequiredWhat a holder of the role does
Becomes the column definition of access_role.
Written at commons/data/models/identity-access/concepts.ts:36
isPrivilegedbooleanrequiredWhether 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 roleKindrequiredWhether the platform or a tenant made it
Becomes the column kind of access_role.
Written at commons/data/models/identity-access/concepts.ts:41
nametextrequiredWhat the role is called
Becomes the column name of access_role.
Written at commons/data/models/identity-access/concepts.ts:40
roleIdidentifierrequiredWhat 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
roleKeytextrequiredThe 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 useStatusrequiredWhether the role is in use
Becomes the column status of access_role.
Written at commons/data/models/identity-access/concepts.ts:45
tenantoptionalThe 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
Projects to the table access_role with the primary key role_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
definition | text | false | attribute | accessRole.definition |
is_privileged | boolean | false | attribute | accessRole.isPrivileged |
kind | text | false | attribute | accessRole.kind |
name | text | false | attribute | accessRole.name |
role_id | text | false | attribute | accessRole.roleId |
role_key | text | false | attribute | accessRole.roleKey |
status | text | false | attribute | accessRole.status |
tenant_id | text | true | reference | accessRole.tenant |
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'))
);CREATE TABLE IF NOT EXISTS "access_role" (
"role_id" TEXT NOT NULL PRIMARY KEY,
"role_key" TEXT NOT NULL,
"name" TEXT NOT NULL,
"kind" TEXT NOT NULL,
"definition" TEXT NOT NULL,
"is_privileged" BOOLEAN NOT NULL,
"status" TEXT NOT NULL,
"tenant_id" TEXT,
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'))
);CREATE TABLE IF NOT EXISTS "access_role" (
"role_id" TEXT NOT NULL PRIMARY KEY,
"role_key" TEXT NOT NULL,
"name" TEXT NOT NULL,
"kind" TEXT NOT NULL,
"definition" TEXT NOT NULL,
"is_privileged" INTEGER NOT NULL,
"status" TEXT NOT NULL,
"tenant_id" TEXT,
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'))
);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);