UNPKG

mira-app-server

Version:

Mira Server - standalone server application using mira-app-core

20 lines 1.02 kB
import { Request, Response, NextFunction } from 'express'; import { SettingsManager } from '../SettingsManager'; export declare function canAccessLibrary(config: any, userRole?: string): boolean; interface AuthServiceLike { validateToken(token: string): Promise<any>; getUserInfo(user: any): any; } interface LibraryStorageLike { getLibraryConfig(libraryId: string): Record<string, any> | null; } /** * 创建统一权限中间件 * * @param authService 认证服务(来自 AuthRouter.getAuthService()) * @param settingsManager 设置管理器 * @param getLibraryStorage 延迟获取 LibraryStorage(因为 HttpServer 构造时 libraries 尚未初始化) */ export declare function createHttpPermissionMiddleware(authService: AuthServiceLike, settingsManager: SettingsManager, getLibraryStorage: () => LibraryStorageLike | undefined): (req: Request, res: Response, next: NextFunction) => Promise<void | Response<any, Record<string, any>>>; export {}; //# sourceMappingURL=permission.d.ts.map