|
|
|
@ -138,6 +138,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { |
|
|
|
|
* Requirements: |
|
|
|
|
* |
|
|
|
|
* - the caller must have ``role``'s admin role. |
|
|
|
|
* |
|
|
|
|
* May emit a {RoleGranted} event. |
|
|
|
|
*/ |
|
|
|
|
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { |
|
|
|
|
_grantRole(role, account); |
|
|
|
@ -151,6 +153,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { |
|
|
|
|
* Requirements: |
|
|
|
|
* |
|
|
|
|
* - the caller must have ``role``'s admin role. |
|
|
|
|
* |
|
|
|
|
* May emit a {RoleRevoked} event. |
|
|
|
|
*/ |
|
|
|
|
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { |
|
|
|
|
_revokeRole(role, account); |
|
|
|
@ -169,6 +173,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { |
|
|
|
|
* Requirements: |
|
|
|
|
* |
|
|
|
|
* - the caller must be `account`. |
|
|
|
|
* |
|
|
|
|
* May emit a {RoleRevoked} event. |
|
|
|
|
*/ |
|
|
|
|
function renounceRole(bytes32 role, address account) public virtual override { |
|
|
|
|
require(account == _msgSender(), "AccessControl: can only renounce roles for self"); |
|
|
|
@ -183,6 +189,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { |
|
|
|
|
* event. Note that unlike {grantRole}, this function doesn't perform any |
|
|
|
|
* checks on the calling account. |
|
|
|
|
* |
|
|
|
|
* May emit a {RoleGranted} event. |
|
|
|
|
* |
|
|
|
|
* [WARNING] |
|
|
|
|
* ==== |
|
|
|
|
* This function should only be called from the constructor when setting |
|
|
|
@ -213,6 +221,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { |
|
|
|
|
* @dev Grants `role` to `account`. |
|
|
|
|
* |
|
|
|
|
* Internal function without access restriction. |
|
|
|
|
* |
|
|
|
|
* May emit a {RoleGranted} event. |
|
|
|
|
*/ |
|
|
|
|
function _grantRole(bytes32 role, address account) internal virtual { |
|
|
|
|
if (!hasRole(role, account)) { |
|
|
|
@ -225,6 +235,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { |
|
|
|
|
* @dev Revokes `role` from `account`. |
|
|
|
|
* |
|
|
|
|
* Internal function without access restriction. |
|
|
|
|
* |
|
|
|
|
* May emit a {RoleRevoked} event. |
|
|
|
|
*/ |
|
|
|
|
function _revokeRole(bytes32 role, address account) internal virtual { |
|
|
|
|
if (hasRole(role, account)) { |
|
|
|
|