问题
In hyperledger fabric, suppose there is a channel, 'channel_12' between org1 and org2 and another channel, 'channel_13' between org1 and org3. Suppose there are 2 users, 'Org1User1' & 'Org1User2' in org1. Can we restrict the access of Org1User1 to channel_12 and that of Org1User2 to channel_13?
回答1:
One way with which we can achieve this is:
While enrolling the user we can set the attributes in the X509 certificate for the user about which channel he has access to. For this, we need to generate a CSR with these details and send it to the CA server.
Now, when the user is submitting the transaction, we can check the value of this attribute on either the client side or within the chaincode. Based on this attribute we can control the access to the channel.
P.S: This is on the certificate level. Would love to know if there are any methods/apis that fabric provides for the same.
来源:https://stackoverflow.com/questions/52056834/restrict-user-access-to-only-some-channels-in-hyperledger-fabric