parent
80e2e20ef9
commit
2f13adfa91
|
@ -0,0 +1,11 @@
|
|||||||
|
[request_definition]
|
||||||
|
r = sub, obj, act
|
||||||
|
|
||||||
|
[policy_definition]
|
||||||
|
p = sub, obj, act
|
||||||
|
|
||||||
|
[policy_effect]
|
||||||
|
e = some(where (p.eft == allow))
|
||||||
|
|
||||||
|
[matchers]
|
||||||
|
m = r.sub == p.sub && r.obj == p.obj && r.act == p.act
|
@ -0,0 +1,9 @@
|
|||||||
|
package middleware
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/casbin/casbin/v2"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
func CasbinACL(c *gin.Context){
|
||||||
|
_, _ := casbin.NewEnforcer("config/model.conf", "config/policy.csv")
|
||||||
|
}
|
Loading…
Reference in new issue