Roles.add and remove now require pre-conditions on the account. (#1421)
(cherry picked from commit 3bd30f7382)
This commit is contained in:
committed by
Leo Arias
parent
e990525c2e
commit
1b79b536cd
@ -14,6 +14,8 @@ library Roles {
|
||||
*/
|
||||
function add(Role storage role, address account) internal {
|
||||
require(account != address(0));
|
||||
require(!has(role, account));
|
||||
|
||||
role.bearer[account] = true;
|
||||
}
|
||||
|
||||
@ -22,6 +24,8 @@ library Roles {
|
||||
*/
|
||||
function remove(Role storage role, address account) internal {
|
||||
require(account != address(0));
|
||||
require(has(role, account));
|
||||
|
||||
role.bearer[account] = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user