Skip to content

Solidity API

SpanningAccessControlEnumerableUpgradeable

Extension of {AccessControl} that allows enumerating the members of each role.

_roleMembers

mapping(bytes32 => struct EnumerableSet.Bytes32Set) _roleMembers

supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)

See {IERC165-supportsInterface}.

getRoleMember

function getRoleMember(bytes32 role, uint256 index) public view virtual returns (bytes32)

_Returns one of the accounts that have role. index must be a value between 0 and {getRoleMemberCount}, non-inclusive.

Role bearers are not sorted in any particular way, and their ordering may change at any point.

WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information._

getRoleMemberCount

function getRoleMemberCount(bytes32 role) public view virtual returns (uint256)

Returns the number of accounts that have role. Can be used together with {getRoleMember} to enumerate all bearers of a role.

_grantRole

function _grantRole(bytes32 role, bytes32 account) internal virtual

_Overload {grantRole} to track enumerable memberships

_revokeRole

function _revokeRole(bytes32 role, bytes32 account) internal virtual

_Overload {revokeRole} to track enumerable memberships