grim/hgkeeper

8f41bf671a91
Parents 9d843fb39620
Children 6837cd82348c
Remove the access function as it's no longer needed
--- a/access/enforcer.go Wed Sep 11 23:28:54 2019 -0500
+++ b/access/enforcer.go Wed Sep 11 23:29:12 2019 -0500
@@ -13,26 +13,6 @@
enforcerLock sync.Mutex
)
-func accessMatch(key1, key2 string) bool {
- switch key2 {
- case "init":
- return key1 == "init" || key1 == "write" || key1 == "read"
- case "write":
- return key1 == "write" || key1 == "read"
- case "read":
- return key1 == "read"
- }
-
- return false
-}
-
-func accessMatchFunc(args ...interface{}) (interface{}, error) {
- key1 := args[0].(string)
- key2 := args[1].(string)
-
- return (bool)(accessMatch(key1, key2)), nil
-}
-
func refreshEnforcer(adminRepoPath string) error {
enforcerLock.Lock()
defer enforcerLock.Unlock()
@@ -45,8 +25,6 @@
e := casbin.NewEnforcer(modelFile, policyFile)
- e.AddFunction("access", accessMatchFunc)
-
enforcer = e
return nil