Automatic merge from release/2.7.0 -> release/2.8.0

* commit '430df17dd3cefe0f25328ce69bf8d8b0d0e95253':
  fix: SyncOnce should invalidate policy cache
  fix: refine policy match conditions
  minor updates
  fix: simplify rbac policy condition to match projects and roles
This commit is contained in:
邱剑
2019-03-21 11:31:11 +08:00
7 changed files with 233 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
})
}