Skip to content

Commit 061f972

Browse files
Krishang NadgaudaKrishang Nadgauda
authored andcommitted
add hasRoleWithSwitch to Permissions
1 parent f05ea15 commit 061f972

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contracts/feature/Permissions.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ contract Permissions is IPermissions {
1919
return _hasRole[role][account];
2020
}
2121

22+
function hasRoleWithSwitch(bytes32 role, address account) public view returns (bool) {
23+
if (!_hasRole[role][address(0)]) {
24+
return _hasRole[role][account];
25+
}
26+
27+
return true;
28+
}
29+
2230
function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
2331
return _getRoleAdmin[role];
2432
}

0 commit comments

Comments
 (0)