Access control (BorgAuth)
Last updated
Was this helpful?
Was this helpful?
uint256 public constant OWNER_ROLE = 99;
uint256 public constant ADMIN_ROLE = 98;
uint256 public constant PRIVILEGED_ROLE = 97;
mapping(address => uint256) public userRoles;
mapping(uint256 => address) public roleAdapters;
function updateRole(address user, uint256 role) external; // caller must hold OWNER_ROLE
function initTransferOwnership(address newOwner) external; // caller must hold OWNER_ROLE
function acceptOwnership() external; // caller must be pendingOwner
function zeroOwner() external; // caller renounces to role 0
function setRoleAdapter(uint256 role, address adapter) external;// caller must hold OWNER_ROLE
function onlyRole(uint256 role, address user) public view; // reverts if under-authorised
function matchRole(uint256 role, address user) public view; // reverts unless exactly equal