Middleware to check if the user's role is authorized.

  • Parameters

    • allowedRoles: string[]

    Returns (req: Request, res: Response, next: NextFunction) => void

    Middleware function that checks the user's role.