ibm-watson-iot / blockchain-samples

Samples demonstrating the use of Blockchain with IBM Watson IoT
https://internetofthings.ibmcloud.com
Apache License 2.0
172 stars 160 forks source link

How to impose restricted access based on participants role. #34

Open mna2016 opened 7 years ago

mna2016 commented 7 years ago

How to have access control at the chaincode level. i.e. If I have 4 users participating in teh use case like Supplier, Transporter, Regulator, End user - How to control the access of these 4 users in chaincode. For example Regulator can see everything. Transporter cannot see data meant for Supplier and End user.

How to have such an access control?

(Ref: I have seen car lease demo another example of IBM blockchain, doing acces control at chaincode level.)

kletkeman commented 7 years ago

Chaincode level is widely regarded as the appropriate mechanism. The "creator" of the transaction is available through the stub API and the fields in there can be used to provide access control. Techniques include denial of the transaction right up front and / or redaction of the response. There is no library for applications yet, however using the Hyperledger Composer for your chain code and applications gives you access to their Access Control Language, which can be used to do most or all of what you want I believe.

mna2016 commented 7 years ago

I am implementing blockchain service hosted on bluemix. So I guess I cannot use the hyperledger composer option(Please correct me if I am not). I will try to use the available "owner\creator" field to have access restriction checks inside of chaincode.

Thanks!

kletkeman commented 7 years ago

The Hyperledger Composer is compatible with both fabric v0.6 and fabric v1, and v0.6 is being deprecated and removed from Bluemix fairly soon. Composer is compatible with Bluemix fabrics, with deployment and communication going through a connection profile designed for Bluemix. I suggest that you read the rocket chat channel for composer here: https://chat.hyperledger.org/channel/composer and ask Composer questions there. They are pretty responsive.