34 lines
798 B
TypeScript
34 lines
798 B
TypeScript
|
|
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[];
|
||
|
|
};
|
||
|
|
}
|