本文整理汇总了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{}{