fix: simplify rbac policy condition to match projects and roles

This commit is contained in:
Qiu Jian
2019-03-21 01:03:51 +08:00
parent 4213db3eb6
commit 06ae94ebe3
5 changed files with 193 additions and 95 deletions
+6 -1
View File
@@ -253,7 +253,7 @@ func init() {
}
req.Add(jsonutils.NewArray(data...), key)
}
fmt.Println(req.String())
fmt.Println("Request:", req.String())
var token mcclient.TokenCredential
if len(args.User) > 0 {
@@ -273,6 +273,11 @@ func init() {
}
printObject(result)
fmt.Println("userCred:", token)
m := policy.PolicyManager.MatchedPolicies(false, token)
fmt.Println("matched policies:", m)
m = policy.PolicyManager.MatchedPolicies(true, token)
fmt.Println("matched admin policies:", m)
return nil
})
}