interface AuthLike { token: string | null; handleUnauthorized(): void; } export interface RoleAssignment { userId: string; roleName: string; grantedBy: string | null; grantedAt: number; } /** Default roles provided by the platform. Devs can add custom roles. */ export declare const DEFAULT_ROLES: readonly ["owner", "member", "moderator", "editor", "viewer"]; export type DefaultRole = (typeof DEFAULT_ROLES)[number]; /** * App-level RBAC — assign, revoke, and check roles for users in your app. * * Default roles (no configuration needed): * owner — auto-assigned to app creator, full control * member — basic authenticated access * moderator — content moderation, user management * editor — CRUD on app data, not settings * viewer — read-only access * * Custom roles: pass any string to assign/revoke/check. * * @example * await app.roles.assign('gh:123', 'moderator') * const has = await app.roles.check('moderator') * const mods = await app.roles.list('moderator') * await app.roles.revoke('gh:123', 'moderator') */ export declare class Roles { private readonly appId; private readonly apiBase; private readonly auth; constructor(appId: string, apiBase: string, auth: AuthLike); /** Assign a role to a user. Caller must be app owner or admin. */ assign(userId: string, role: string): Promise; /** Revoke a role from a user. Caller must be app owner or admin. */ revoke(userId: string, role: string): Promise; /** Check if the current user has a specific role in this app. */ check(role: string): Promise; /** List all role assignments for this app. Caller must be app owner or admin. */ listAll(): Promise; /** List all users with a specific role. Caller must be app owner or admin. */ list(role: string): Promise; /** Get the current user's roles in this app. */ myRoles(): Promise; private post; private del; } export {}; //# sourceMappingURL=roles.d.ts.map