Managing Access Roles
Under the hood of Flexible (opens in a new tab), a role-based access control mechanism determines who can edit theming data for a given platform. By default, the person who creates a platformIndex
for a specific platform is given admin privileges. Moreover, methods are provided for easy management of multiple administrators/managers of a deployment. You can view the code for the theme registry contract here (opens in a new tab).
How to Grant Roles
Quickstart
Visit Etherscan
Head to Etherscan (opens in a new tab) and connect your wallet.
Prepare the grantRoles
function
Once connected, supply the appropriate function arguments.
-
platformIndex
The index number created via using a Flexible template If you haven't minted it yet, check out our Getting Started page. -
roleDetails
The Ethereum address which you want to grant a role, followed by the number corresponding to that role. Below is an example of how the tuple should be formatted.
[["0x9798A181E731Ee9d3abffc5ae15c93cA3d95A8e3", "1"]]
You can assign a role to multiple addresses in the same transaction by separating the Ethereum addresses with commas.
Name | Value |
---|---|
0 | NO ROLE |
1 | MANAGER (able to make changes to a platform's theme) |
2 | ADMIN (able to make changes to a platforms's theme, and add and revoke roles) |
If you experience any errors make sure your tuple is formatted correctly.
Confirm the transaction
Click the "Write" button next to the function, this will prompt a confirmation window from your wallet. Keep in mind that you'll have to pay gas fees for the transaction, so make sure you have enough ether in your wallet to cover these costs. After confirming the transaction, you can view its details on Etherscan by clicking on the transaction hash.