education
education copied to clipboard
How to manage role based access in Chaincode
I want to put restriction on uses according to their role to call chaincode functions. For eg. In tunaFish example I do not want the Regulator or Restaurateur to call a function recordTuna. So how do I manage this.
Can we restrict this access in chaincode or do we have to manange this at application side?
You should handle this in the chaincode. Attribute-based access control can be of help here. You can query the role attribute in your chaincode and put access restriction as required.
https://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html