import type { PermissionCheck } from "@prodobit/types"; import type { Context, Next } from "hono"; /** * RBAC Permission Service */ export declare class RBACService { /** * Get user permissions for a tenant */ static getUserPermissions(db: any, userId: string, tenantId?: string): Promise; /** * Check if user has specific permission */ static hasPermission(db: any, userId: string, check: PermissionCheck, tenantId?: string): Promise; /** * Check if user has any of the specified permissions */ static hasAnyPermission(db: any, userId: string, checks: PermissionCheck[], tenantId?: string): Promise; /** * Check if user has all specified permissions */ static hasAllPermissions(db: any, userId: string, checks: PermissionCheck[], tenantId?: string): Promise; /** * Get user roles in tenant */ static getUserRoles(db: any, userId: string, tenantId?: string): Promise>; /** * Check if user is tenant member with specific role */ static isTenantMember(db: any, userId: string, tenantId: string, requiredRole?: string): Promise; } /** * RBAC middleware factory - requires specific permission */ export declare const requirePermission: (resource: string, action: string, scope?: "tenant" | "global" | "own") => (c: Context, next: Next) => Promise<(Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 401, "json">) | (Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 403, "json">) | (Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 500, "json">) | undefined>; /** * Require any of the specified permissions */ export declare const requireAnyPermission: (...permissions: Array<{ resource: string; action: string; }>) => (c: Context, next: Next) => Promise<(Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 401, "json">) | (Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 403, "json">) | (Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 500, "json">) | undefined>; /** * Require specific role */ export declare const requireRole: (roleName: string) => (c: Context, next: Next) => Promise<(Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 401, "json">) | (Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 403, "json">) | (Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 500, "json">) | undefined>; /** * Require tenant membership */ export declare const requireTenantMember: (requiredRole?: string) => (c: Context, next: Next) => Promise<(Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 401, "json">) | (Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 400, "json">) | (Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 403, "json">) | (Response & import("hono").TypedResponse<{ success: false; error: { code: string; message: string; }; }, 500, "json">) | undefined>; export default RBACService; //# sourceMappingURL=rbac.d.ts.map