mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-30 17:13:08 +08:00
feature: keystone support phase 1
This commit is contained in:
@@ -29,6 +29,7 @@ import (
|
||||
"yunion.io/x/pkg/utils"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
"sort"
|
||||
"yunion.io/x/onecloud/pkg/appsrv"
|
||||
"yunion.io/x/onecloud/pkg/appsrv/dispatcher"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
|
||||
|
||||
@@ -238,5 +238,17 @@ var (
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Service: "identity",
|
||||
Resource: "policies",
|
||||
Action: PolicyActionList,
|
||||
Result: rbacutils.UserAllow,
|
||||
},
|
||||
{
|
||||
Service: "identity",
|
||||
Resource: "policies",
|
||||
Action: PolicyActionGet,
|
||||
Result: rbacutils.UserAllow,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -16,6 +16,8 @@ package modules
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/utils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/util/rbacutils"
|
||||
@@ -29,7 +31,7 @@ var Policies SPolicyManager
|
||||
|
||||
func policyReadFilter(session *mcclient.ClientSession, s jsonutils.JSONObject, query jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
ss := s.(*jsonutils.JSONDict)
|
||||
ret := ss.CopyIncludes("id", "type", "enabled", "domain_id", "domain")
|
||||
ret := ss.CopyIncludes("id", "type", "enabled", "domain_id", "domain", "can_update", "can_delete")
|
||||
blobJson, _ := ss.Get("blob")
|
||||
if blobJson != nil {
|
||||
policy := rbacutils.SRbacPolicy{}
|
||||
@@ -77,7 +79,6 @@ func policyWriteFilter(session *mcclient.ClientSession, s jsonutils.JSONObject,
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
// ret.Add(jsonutils.NewString(blobJson.String()), "blob")
|
||||
ret.Add(blobJson, "blob")
|
||||
}
|
||||
if s.Contains("type") {
|
||||
|
||||
Reference in New Issue
Block a user