Improve encapsulation on SignatureBouncer, Whitelist and RBAC example (#1265)

* Improve encapsulation on Whitelist

* remove only

* update whitelisted crowdsale test

* Improve encapsulation on SignatureBouncer

* fix missing test

* Improve encapsulation on RBAC example

* Improve encapsulation on RBAC example

* Remove extra visibility

* Improve encapsulation on ERC20 Mintable

* Improve encapsulation on Superuser

* fix lint

* add missing constant
This commit is contained in:
Leo Arias
2018-09-03 16:06:43 -06:00
committed by Francisco Giordano
parent b0f20d43df
commit f4eb51a7e9
11 changed files with 58 additions and 53 deletions

View File

@ -19,7 +19,7 @@ contract RBACWithAdmin is RBAC {
/**
* A constant role name for indicating admins.
*/
string public constant ROLE_ADMIN = "admin";
string private constant ROLE_ADMIN = "admin";
/**
* @dev modifier to scope access to admins
@ -40,6 +40,13 @@ contract RBACWithAdmin is RBAC {
_addRole(msg.sender, ROLE_ADMIN);
}
/**
* @return true if the account is admin, false otherwise.
*/
function isAdmin(address _account) public view returns(bool) {
return hasRole(_account, ROLE_ADMIN);
}
/**
* @dev add a role to an account
* @param _account the account that will have the role