I Access Control
External interface of AccessControl declared to support ERC165 detection.
Methods
getRoleAdmin
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {AccessControl-_setRoleAdmin}.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
grantRole
Grants role
to account
. If account
had not been already granted role
, emits a {RoleGranted} event. Requirements: - the caller must have role
's admin role.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
hasRole
Returns true
if account
has been granted role
.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
renounceRole
Revokes role
from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must be account
.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
revokeRole
Revokes role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
Events
RoleAdminChanged
Emitted when newAdminRole
is set as role
's admin role, replacing previousAdminRole
DEFAULT_ADMIN_ROLE
is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. Available since v3.1.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
previousAdminRole | bytes32 | undefined |
newAdminRole | bytes32 | undefined |
RoleGranted
Emitted when account
is granted role
. sender
is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
sender | address | undefined |
RoleRevoked
Emitted when account
is revoked role
. sender
is the account that originated the contract call: - if using revokeRole
, it is the admin role bearer - if using renounceRole
, it is the role bearer (i.e. account
)
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
sender | address | undefined |
Last updated