education icon indicating copy to clipboard operation
education copied to clipboard

How to manage role based access in Chaincode

Open rushikeshacharya opened this issue 7 years ago • 1 comments

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?

rushikeshacharya avatar Nov 23 '18 09:11 rushikeshacharya

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

vishal3152 avatar Nov 23 '18 10:11 vishal3152