Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Access Control - Roles By Account #2139 #2297

Conversation

julianmrodri
Copy link
Contributor

@julianmrodri julianmrodri commented Jun 29, 2020

2139

Fixes #2139

This PR introduces the required changes to be able to enumerate all Roles for a specific Account.

It is developed following the same approach currently implemented for getting all role members. It implements two functions that need to be used together. One to get the count of roles for a specific account and then another one to get each individual Role. (Requires to iterate from outside the contract).

function getAccountRoleCount(address account) public view returns (uint256)
function getAccountRole(address account, uint256 index) public view returns (bytes32)

In addition to this, I had to create a new implementation for EnumerableSet named Bytes32Set.

  • All tests implemented. All lint checks passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query AccessControl roles per account
1 participant