本文整理匯總了Golang中github.com/cloudwan/gohan/schema.Manager.PolicyValidate方法的典型用法代碼示例。如果您正苦於以下問題:Golang Manager.PolicyValidate方法的具體用法?Golang Manager.PolicyValidate怎麽用?Golang Manager.PolicyValidate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudwan/gohan/schema.Manager
的用法示例。
在下文中一共展示了Manager.PolicyValidate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
subnet1 = map[string]interface{}{
"id": "test3",
"name": "Minas Tirith",
"tenant_id": adminTenantID,
"cidr": "10.10.0.0/16",
}
})
JustBeforeEach(func() {
var ok bool
currentSchema, ok = manager.Schema(schemaID)
Expect(ok).To(BeTrue())
path = currentSchema.GetPluralURL()
policy, role := manager.PolicyValidate(action, path, auth)
Expect(policy).NotTo(BeNil())
context["policy"] = policy
context["role"] = role
context["tenant_id"] = auth.TenantID()
context["tenant_name"] = auth.TenantName()
context["auth_token"] = auth.AuthToken()
context["catalog"] = auth.Catalog()
context["auth"] = auth
context["identity_service"] = &middleware.FakeIdentity{}
env = otto.NewEnvironment(testDB, &middleware.FakeIdentity{})
environmentManager.RegisterEnvironment(schemaID, env)
extensions = []*schema.Extension{}
for event, javascript := range events {
extension, err := schema.NewExtension(map[string]interface{}{