# Access Control

It allows an admin to manage access control via roles.

## Structs

### <mark style="color:blue;">AccessControl</mark>

```rust
struct AccessControl has key, store {
 id: UID,
 roles: VecMap<vector<u8>, VecSet<address>>
}
```

* **roles -** Map to store a role => set of addresses with said role.

### <mark style="color:blue;">Admin</mark>

```rust
struct Admin has key, store {
 id: UID,
 access_control: address
}
```

* Address of the `AccessControl` this capability belongs to.&#x20;

## Interface

### <mark style="color:blue;">new</mark>

**It creates an \`AccessControl\`  and an \`Admin\` with the \`SUPER\_ADMIN\_ROLE\`.**&#x20;

```rust
public fun new(ctx: &mut TxContext): (AccessControl, Admin)
```

* **@return** \`AccessControl\`. It stores the role's data.
* **@return \`**&#x41;dmin\`. The \`SUPER\_ADMIN\_ROLE\` \`Admin\`.


---

# 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.interestprotocol.com/overview/deprecated/sui-tears/capabilities/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.
