16 lines
561 B
TypeScript
16 lines
561 B
TypeScript
import { Request, Response, NextFunction } from 'express';
|
|
import { Role } from '../types/index.js';
|
|
export interface AuthenticatedRequest extends Request {
|
|
boardAuth?: {
|
|
boardId: string;
|
|
role: Role;
|
|
board: any;
|
|
};
|
|
}
|
|
/**
|
|
* Middleware to require board authorization.
|
|
* Role parameter defaults to allowing both 'admin' and 'member'.
|
|
* Pass 'admin' to restrict to superadmin only.
|
|
*/
|
|
export declare function requireBoardAuth(requiredRole?: Role): (req: AuthenticatedRequest, res: Response, next: NextFunction) => Promise<void>;
|