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