From 1ccc5d1141eceb00f87bb90e8d379d47a2f25959 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 15 Jan 2024 23:46:54 -0500 Subject: [PATCH] fix: fix policies --- api/casbin.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/casbin.go b/api/casbin.go index e5d539b..04df051 100644 --- a/api/casbin.go +++ b/api/casbin.go @@ -25,9 +25,7 @@ func GetCasbin(logger *zap.Logger) *casbin.Enforcer { } // Add policies after creating the enforcer - _ = a.AddPolicy("admin", "/admin", []string{"GET"}) - _ = a.AddPolicy("admin", "/admin", []string{"POST"}) - _ = a.AddPolicy("admin", "/admin", []string{"DELETE"}) + _ = a.AddPolicy("p", "p", []string{"admin", "/admin*", "(GET|POST|DELETE)"}) err = e.LoadPolicy() if err != nil {