# Access Control

> *Address:* [*0x385b8Fa7A4bC0dB2149B1AB1928AfD21D551bd3d*](https://polygonscan.com/address/0x385C31C64262904e47e20F8f614B7aF0080650F7#code)

Adapted version of [Access Control from OpenZeppelin](https://docs.openzeppelin.com/contracts/api/access#AccessControl) to fit the storage-module architecture, that allows contracts to implement role-based mechanisms. When `DIMORegistry` is deployed, the `DEFAULT_ADMIN_ROLE` is assigned to the deployer in order to allow them to fully manage the system. This role also permits the creation, granting, and revoking of roles from other addresses.

To manage access to a function, we can use the `onlyRole` modifier and specify the role that the `msg.sender` must have to invoke that function.

```solidity
function mockFunction(...) external onlyRole(ROLE) {…}
```

In the future, more functions may be added to increase the separation of concerns in the use of contracts and the roles of managers and users.
