Access Control

It allows an admin to manage access control via roles.

Structs

AccessControl

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.

Admin

struct Admin has key, store {
 id: UID,
 access_control: address
}
  • Address of the AccessControl this capability belongs to.

Interface

new

It creates an `AccessControl` and an `Admin` with the `SUPER_ADMIN_ROLE`.

public fun new(ctx: &mut TxContext): (AccessControl, Admin)
  • @return `AccessControl`. It stores the role's data.

  • @return `Admin`. The `SUPER_ADMIN_ROLE` `Admin`.

Last updated