We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb5b457 commit 703e630Copy full SHA for 703e630
1 file changed
middleware.go
@@ -2,6 +2,7 @@ package fibercasbinrest
2
3
import (
4
"log"
5
+ "net/http"
6
"strings"
7
8
"github.com/casbin/casbin/v2"
@@ -55,7 +56,8 @@ func middlewareWithConfig(config Config) fiber.Handler {
55
56
if config.Skipper(c) || config.CheckPermissions(c) {
57
return c.Next()
58
}
- return fiber.ErrForbidden
59
+ return c.Status(http.StatusForbidden).
60
+ JSON(fiber.Map{"message": "Forbidden"})
61
62
63
0 commit comments