Files
interfaces/ts/data/role.ts
T

34 lines
798 B
TypeScript
Raw Normal View History

2026-05-06 15:04:33 +00:00
import * as plugins from '../plugins.js';
/** Standard role types available in all organizations */
export type TStandardRole = 'owner' | 'admin' | 'editor' | 'guest' | 'viewer' | 'outlaw';
export interface IOrgRoleDefinition {
key: string;
name: string;
description?: string;
createdAt: number;
updatedAt: number;
}
export interface IAppRoleMapping {
orgRoleKey: string;
appRoles: string[];
permissions: string[];
scopes: string[];
}
/**
* A role describes a user's permissions within an organization.
* Users can have multiple roles (e.g., ['owner', 'billing-admin']).
*/
export interface IRole {
id: string;
data: {
userId: string;
organizationId: string;
/** Array of roles - supports standard roles and custom role names */
roles: string[];
};
}