Merge pull request #495 in YUNIONIO/onecloud from ~QIUJIAN/onecloud:hotfix/qj-fix-rbac-enable-incompatible to release/2.3.0

* commit '43f9b6d61c7d9a24284e0b2baa42f6fae4b30c3d':
  修正:climc调用rbac接口参数错误
This commit is contained in:
邱剑
2018-11-13 22:35:19 +08:00
+2 -2
View File
@@ -188,7 +188,7 @@ func init() {
}
R(&PolicyAdminCapableOptions{}, "policy-admin-capable", "Check admin capable", func(s *mcclient.ClientSession, args *PolicyAdminCapableOptions) error {
auth.InitFromClientSession(s)
policy.EnableGlobalRbac(15*time.Second, 15*time.Second)
policy.EnableGlobalRbac(15*time.Second, 15*time.Second, false)
capable := policy.PolicyManager.IsAdminCapable(s.GetToken())
fmt.Printf("%v\n", capable)
@@ -201,7 +201,7 @@ func init() {
}
R(&PolicyExplainOptions{}, "policy-explain", "Explain policy result", func(s *mcclient.ClientSession, args *PolicyExplainOptions) error {
auth.InitFromClientSession(s)
policy.EnableGlobalRbac(15*time.Second, 15*time.Second)
policy.EnableGlobalRbac(15*time.Second, 15*time.Second, false)
req := jsonutils.NewDict()
for i := 0; i < len(args.Request); i += 1 {