@rbac/rbac
Version:
Blazing Fast, Zero dependency, Hierarchical Role-Based Access Control for Node.js
23 lines (22 loc) • 711 B
TypeScript
import type { Role, Roles } from '../types';
import type { RoleAdapter } from './adapter';
export interface MySQLAdapterOptions {
uri?: string;
config?: any;
table: string;
columns?: {
name?: string;
role?: string;
tenantId?: string;
};
}
export declare class MySQLRoleAdapter<P = unknown> implements RoleAdapter<P> {
private options;
private connection?;
private defaultTenant;
constructor(options: MySQLAdapterOptions);
private getConnection;
getRoles(tenantId?: string): Promise<Roles<P>>;
addRole(roleName: string, role: Role<P>, tenantId?: string): Promise<void>;
updateRoles(roles: Roles<P>, tenantId?: string): Promise<void>;
}