pragma solidity ^0.6.0; import "./DynamicAccessControl.sol"; import "./RoleSets.sol"; contract ControlledContract is DynamicAccessControl { using RoleSets for RoleSets.RoleSet; RoleSets.RoleSet rootRoleSet; RoleSets.RoleSet secondaryRoleSet; RoleSets.RoleSet tertiaryRoleSet; bytes32 public constant ROOT_ROLE_SET = 0x00; constructor() public DynamicAccessControl(msg.sender) { rootRoleSet.addRoleId(ROOT_ROLE_SET); secondaryRoleSet.addRoleId(ROOT_ROLE_SET); tertiaryRoleSet.addRoleId(ROOT_ROLE_SET); } function addRoleToSecondarySet(bytes32 _roleId) public onlyMembersOf(rootRoleSet.roleIds){ secondaryRoleSet.addRoleId(_roleId); } function addRoleToTertiarySet(bytes32 _roleId) public onlyMembersOf(secondaryRoleSet.roleIds){ tertiaryRoleSet.addRoleId(_roleId); } }
0.6.0