using new organization

This commit is contained in:
Ming Deng
2020-12-13 23:09:19 +08:00
parent 093f976365
commit a70f7fc920
253 changed files with 504 additions and 503 deletions

View File

@@ -15,8 +15,8 @@
// Package authz provides handlers to enable ACL, RBAC, ABAC authorization support.
// Simple Usage:
// import(
// "github.com/astaxie/beego"
// "github.com/astaxie/beego/plugins/authz"
// "github.com/beego/beego"
// "github.com/beego/beego/plugins/authz"
// "github.com/casbin/casbin"
// )
//
@@ -44,10 +44,10 @@ import (
"github.com/casbin/casbin"
beego "github.com/astaxie/beego/adapter"
"github.com/astaxie/beego/adapter/context"
beecontext "github.com/astaxie/beego/server/web/context"
"github.com/astaxie/beego/server/web/filter/authz"
beego "github.com/beego/beego/adapter"
"github.com/beego/beego/adapter/context"
beecontext "github.com/beego/beego/server/web/context"
"github.com/beego/beego/server/web/filter/authz"
)
// NewAuthorizer returns the authorizer.

View File

@@ -11,4 +11,4 @@ g = _, _
e = some(where (p.eft == allow))
[matchers]
m = g(r.sub, p.sub) && keyMatch(r.obj, p.obj) && (r.act == p.act || p.act == "*")
m = g(r.sub, p.sub) && keyMatch(r.obj, p.obj) && (r.act == p.act || p.act == "*")

View File

@@ -4,4 +4,4 @@ p, bob, /dataset2/resource1, *
p, bob, /dataset2/resource2, GET
p, bob, /dataset2/folder1/*, POST
p, dataset1_admin, /dataset1/*, *
g, cathy, dataset1_admin
g, cathy, dataset1_admin
1 p, alice, /dataset1/*, GET
4 p, bob, /dataset2/resource2, GET
5 p, bob, /dataset2/folder1/*, POST
6 p, dataset1_admin, /dataset1/*, *
7 g, cathy, dataset1_admin

View File

@@ -19,9 +19,9 @@ import (
"net/http/httptest"
"testing"
beego "github.com/astaxie/beego/adapter"
"github.com/astaxie/beego/adapter/context"
"github.com/astaxie/beego/adapter/plugins/auth"
beego "github.com/beego/beego/adapter"
"github.com/beego/beego/adapter/context"
"github.com/beego/beego/adapter/plugins/auth"
"github.com/casbin/casbin"
)