|
@@ -178,6 +178,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
|
|
* Using this function in any other way is effectively circumventing the admin
|
|
* Using this function in any other way is effectively circumventing the admin
|
|
* system imposed by {AccessControl}.
|
|
* system imposed by {AccessControl}.
|
|
* ====
|
|
* ====
|
|
|
|
+ *
|
|
|
|
+ * NOTE: This function is deprecated in favor of {_grantRole}.
|
|
*/
|
|
*/
|
|
function _setupRole(bytes32 role, address account) internal virtual {
|
|
function _setupRole(bytes32 role, address account) internal virtual {
|
|
_grantRole(role, account);
|
|
_grantRole(role, account);
|
|
@@ -194,14 +196,24 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
|
|
emit RoleAdminChanged(role, previousAdminRole, adminRole);
|
|
emit RoleAdminChanged(role, previousAdminRole, adminRole);
|
|
}
|
|
}
|
|
|
|
|
|
- function _grantRole(bytes32 role, address account) private {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @dev Grants `role` to `account`.
|
|
|
|
+ *
|
|
|
|
+ * Internal function without access restriction.
|
|
|
|
+ */
|
|
|
|
+ function _grantRole(bytes32 role, address account) internal virtual {
|
|
if (!hasRole(role, account)) {
|
|
if (!hasRole(role, account)) {
|
|
_roles[role].members[account] = true;
|
|
_roles[role].members[account] = true;
|
|
emit RoleGranted(role, account, _msgSender());
|
|
emit RoleGranted(role, account, _msgSender());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- function _revokeRole(bytes32 role, address account) private {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @dev Revokes `role` from `account`.
|
|
|
|
+ *
|
|
|
|
+ * Internal function without access restriction.
|
|
|
|
+ */
|
|
|
|
+ function _revokeRole(bytes32 role, address account) internal virtual {
|
|
if (hasRole(role, account)) {
|
|
if (hasRole(role, account)) {
|
|
_roles[role].members[account] = false;
|
|
_roles[role].members[account] = false;
|
|
emit RoleRevoked(role, account, _msgSender());
|
|
emit RoleRevoked(role, account, _msgSender());
|