代码拉取完成,页面将自动刷新
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package aclmgmt
import (
"sync"
"github.com/hyperledger/fabric/common/flogging"
)
var aclLogger = flogging.MustGetLogger("aclmgmt")
type ACLProvider interface {
//CheckACL checks the ACL for the resource for the channel using the
//idinfo. idinfo is an object such as SignedProposal from which an
//id can be extracted for testing against a policy
CheckACL(resName string, channelID string, idinfo interface{}) error
}
//---------- custom tx processor initialized once by peer -------
var configtxLock sync.RWMutex
//---------- ACLProvider intialized once SCCs are brought up by peer ---------
var aclProvider ACLProvider
var once sync.Once
//---------- ACLProvider intialized once SCCs are brought up by peer ---------
//RegisterACLProvider will be called to register an ACLProvider.
//Users can write their own ACLProvider and register. If not provided,
//the standard resource based ACLProvider will be created and registered
func RegisterACLProvider(prov ACLProvider) {
once.Do(func() {
configtxLock.Lock()
defer configtxLock.Unlock()
//if an external prov is not supplied, create
//a resource based ACLProvider and register
if aclProvider = prov; aclProvider == nil {
aclProvider = newACLMgmt(nil)
}
})
}
//GetACLProvider returns ACLProvider
func GetACLProvider() ACLProvider {
if aclProvider == nil {
panic("-----RegisterACLProvider not called -----")
}
return aclProvider
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。