ShiftWise API Docs
    Preparing search index...

    Function Forbidden

    • Creates a 403 Forbidden error. Use when the user is authenticated but lacks the required role or permission.

      Parameters

      • msg: string = "Forbidden"

        Error message (default: "Forbidden")

      Returns AppError

      AppError with status 403 and code FORBIDDEN

      if (membership.role === 'EMPLOYEE') return next(Forbidden('Managers only'))