MCPcopy
hub / github.com/hyperledger/fabric / checkACL

Method checkACL

core/chaincode/handler.go:376–394  ·  view source on GitHub ↗

Check if the transactor is allow to call this chaincode on this channel

(signedProp *pb.SignedProposal, proposal *pb.Proposal, ccIns *sysccprovider.ChaincodeInstance)

Source from the content-addressed store, hash-verified

374
375// Check if the transactor is allow to call this chaincode on this channel
376func (h *Handler) checkACL(signedProp *pb.SignedProposal, proposal *pb.Proposal, ccIns *sysccprovider.ChaincodeInstance) error {
377 // if we are here, all we know is that the invoked chaincode is either
378 // - a system chaincode that *is* invokable through a cc2cc
379 // (but we may still have to determine whether the invoker can perform this invocation)
380 // - an application chaincode
381 // (and we still need to determine whether the invoker can invoke it)
382
383 if h.BuiltinSCCs.IsSysCC(ccIns.ChaincodeName) {
384 // Allow this call
385 return nil
386 }
387
388 // A Nil signedProp will be rejected for non-system chaincodes
389 if signedProp == nil {
390 return errors.Errorf("signed proposal must not be nil from caller [%s]", ccIns.String())
391 }
392
393 return h.ACLProvider.CheckACL(resources.Peer_ChaincodeToChaincode, ccIns.ChannelID, signedProp)
394}
395
396func (h *Handler) deregister() {
397 h.Registry.Deregister(h.chaincodeID)

Callers 1

HandleInvokeChaincodeMethod · 0.95

Calls 4

IsSysCCMethod · 0.65
ErrorfMethod · 0.65
CheckACLMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected