// SPDX-License-Identifier: UNLICENSED pragma solidity =0.8.18; import "@openzeppelin/contracts/access/IAccessControl.sol"; import "../../utils/security/IPausable.sol"; import "../../utils/SomaContract.sol"; import "../ISomaAccessControl.sol"; import "./IAccessible.sol"; /** * @notice Implementation of the {IAccessible} interface. */ abstract contract Accessible is IAccessible, SomaContract { /** * @notice The modifier that restricts a function caller to accounts that have been granted `role`. * @param role The role that an account must have to execute a function. */ modifier onlyRole(bytes32 role) { require(hasRole(role, _msgSender()), "SomaAccessControl: caller does not have the appropriate authority"); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessible).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IAccessible */ // slither-disable-next-line external-function function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return IAccessControl(SOMA.access()).getRoleAdmin(role); } /** * @inheritdoc IAccessible */ function hasRole(bytes32 role, address account) public view override returns (bool) { return IAccessControl(SOMA.access()).hasRole(role, account); } }