IDotnsRoleManager
Inherits: IAccessControl
Title: DotNS Role Manager
Shared owner-administered role API for DotNS contracts with operational roles.
Role identifiers are declared in DotnsConstants. Ownership remains the source of
super-user authority: the owner grants and revokes supported roles, while role holders
receive only the operational permissions each consuming contract recognises.
Note: security-contact: admin@parity.io
Functions
setRole
Grants or revokes an operational role.
Only the owner can manage roles (otherwise @custom:reverts OwnableUnauthorizedAccount);
role must be one of the roles recognised by the consuming contract (otherwise
Notes:
-
reverts: UnsupportedRole);
accountmust not be the zero address (otherwise -
reverts: InvalidRoleAccount). Emits @custom:emits IAccessControl.RoleGranted on grant and @custom:emits IAccessControl.RoleRevoked on revoke.
function setRole(bytes32 role, address account, bool enabled) external;
Parameters
| Name | Type | Description |
|---|---|---|
role | bytes32 | Role identifier declared in DotnsConstants. |
account | address | Account whose role membership is updated. |
enabled | bool | Whether the role should be granted or revoked. |
Errors
NotRoleOrOwner
Thrown when a caller is neither the contract owner nor a holder of role.
error NotRoleOrOwner(address caller, bytes32 role);
UnsupportedRole
Thrown when role management is attempted for a role the contract does not use.
error UnsupportedRole(bytes32 role);
InvalidRoleAccount
Thrown when role management is attempted for the zero address.
error InvalidRoleAccount(address account);