# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dimo.org/protocol/identity-protocol/auxiliary-contracts/access-control.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
