This guide provides a walkthrough for interacting with the peaq RBAC (role-based access control) precompile. Applicable to all peaq networks.
The RBAC precompile is integrated into our JavaScript SDK, serving as the underlying mechanism that triggers the corresponding substrate extrinsic.
rbac.sol
.rbac.sol
file. The precompile is found at
the peaq node source code.rbac.sol
file by clicking on the Solidity Compiler tab and selecting the appropriate compiler version.0x0000000000000000000000000000000000000802
.On the bottom left your the Remix interface you will get the following functions you can interact with:
The RBAC smart contract provides extensive role-based access management capabilities. Below are some key functions categorized by their purpose:
role_id
: A unique identifier for the role.name
: Bytes representing the name of the role.role_id
: Identifier of the role to update.name
: Updated name in bytes.role_id
: Identifier of the role to disable.permission_id
: A unique identifier for the permission.name
: Bytes representing the name of the permission.permission_id
: Identifier of the permission.role_id
: Identifier of the role.group_id
: A unique identifier for the group.name
: Bytes representing the group name.user_id
: Identifier of the user.group_id
: Identifier of the group.After getting an understanding of these key functions, feel free to interact with the RBAC controls that were not mentioned in this document.
For more exhaustive definitions please look at the RBAC Operations in the SDK.