代码拉取完成,页面将自动刷新
/*
Copyright State Street Corp. 2018 All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package channelconfig
import (
pb "github.com/hyperledger/fabric/protos/peer"
)
// aclsProvider provides mappings for resource to policy names
type aclsProvider struct {
aclPolicyRefs map[string]string
}
func (ag *aclsProvider) PolicyRefForAPI(aclName string) string {
return ag.aclPolicyRefs[aclName]
}
// this translates policies to absolute paths if needed
func newAPIsProvider(acls map[string]*pb.APIResource) *aclsProvider {
aclPolicyRefs := make(map[string]string)
for key, acl := range acls {
// If the policy is fully qualified, ie to /Channel/Application/Readers leave it alone
// otherwise, make it fully qualified referring to /Channel/Application/policyName
if '/' != acl.PolicyRef[0] {
aclPolicyRefs[key] = "/" + ChannelGroupKey + "/" + ApplicationGroupKey + "/" + acl.PolicyRef
} else {
aclPolicyRefs[key] = acl.PolicyRef
}
}
return &aclsProvider{
aclPolicyRefs: aclPolicyRefs,
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。