Hyperledger Fabric (HLF) / Attribute Based Access Control (ABAC) Node.js
This is my contribution to the samlinux blockchain academy (SBA) on Juni 18th 2021.
This is the first session of the biweekly crowdcast session series about Hyperledger Fabric Developer with special focus on Node.js development. The session series shows a little bit of my own preparation process for the Hyperledger Fabric Developer certification.
In this first session I would like to share how you can use the concept of attribute based access control (ABAC) in your chaincode, implemented with Node.js. Based on a simple chaincode I give an overview of the background of this concept and I conclude with a hands-on example written in Node.js.
Starting from a development environment, running in –peer-chaincodedev mode, we are going to discover the following methods:
- cid.GetID(stub)
- cid.GetMSPID(stub)
- cid.GetAttributeValue(stub, “attr1”)
- cid.assertAttributeValue(attrName, attrValue)
The following network setup is used for this example: