Check if the transactor is allow to call this chaincode on this channel
(signedProp *pb.SignedProposal, proposal *pb.Proposal, ccIns *sysccprovider.ChaincodeInstance)
| 374 | |
| 375 | // Check if the transactor is allow to call this chaincode on this channel |
| 376 | func (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 | |
| 396 | func (h *Handler) deregister() { |
| 397 | h.Registry.Deregister(h.chaincodeID) |
no test coverage detected