RBAC
contract RBAC
Stores and provides setters and getters for roles and addresses. Supports unlimited numbers of roles and addresses. See //contracts/mocks/RBACMock.sol for an example of usage. This RBAC method uses strings to key roles. It may be beneficial for you to write your own implementation of this interface using Enums or similar.
Source: rbac/RBAC.sol
Reference
Events
RoleAdded
event RoleAdded(address operator, string role)
- Parameters:
operator
- addressrole
- string
RoleRemoved
event RoleRemoved(address operator, string role)
- Parameters:
operator
- addressrole
- string
Modifiers
onlyRole
modifier onlyRole(string _role)
Modifier to scope access to a single role (uses msg.sender as addr).
- Parameters:
_role
- the name of the role // reverts
Functions
addRole
function addRole(address _operator, string _role) internal
Add a role to an address.
- Parameters:
_operator
- address_role
- the name of the role
checkRole
function checkRole(address _operator, string _role) public view
Reverts if addr does not have role.
- Parameters:
_operator
- address_role
- the name of the role // reverts
hasRole
function hasRole(address _operator, string _role) public view returns (bool)
Determine if addr has role.
- Parameters:
_operator
- address_role
- the name of the role- Returns:
- bool
removeRole
function removeRole(address _operator, string _role) internal
Remove a role from an address.
- Parameters:
_operator
- address_role
- the name of the role