Creates a 403 Forbidden error. Use when the user is authenticated but lacks the required role or permission.
403 Forbidden
Error message (default: "Forbidden")
"Forbidden"
AppError with status 403 and code FORBIDDEN
AppError
403
FORBIDDEN
if (membership.role === 'EMPLOYEE') return next(Forbidden('Managers only')) Copy
if (membership.role === 'EMPLOYEE') return next(Forbidden('Managers only'))
Creates a
403 Forbiddenerror. Use when the user is authenticated but lacks the required role or permission.