UNPKG

@rbac/rbac

Version:

Blazing Fast, Zero dependency, Hierarchical Role-Based Access Control for Node.js

23 lines (22 loc) 722 B
import type { Role, Roles } from '../types'; import type { RoleAdapter } from './adapter'; export interface PostgresAdapterOptions { table: string; columns?: { name?: string; role?: string; tenantId?: string; }; [key: string]: any; } export declare class PostgresRoleAdapter<P = unknown> implements RoleAdapter<P> { private options; private client; private connected; private defaultTenant; constructor(options: PostgresAdapterOptions); private getClient; getRoles(tenantId?: string): Promise<Roles<P>>; addRole(roleName: string, role: Role<P>, tenantId?: string): Promise<void>; updateRoles(roles: Roles<P>, tenantId?: string): Promise<void>; }