Skip to content

Latest commit

 

History

History
119 lines (55 loc) · 2.76 KB

acl.md

File metadata and controls

119 lines (55 loc) · 2.76 KB

Module 0x1::acl

Access control list (acl) module. An acl is a list of account addresses who have the access permission to a certain object. This module uses a vector to represent the list, but can be refactored to use a "set" instead when it's available in the language in the future.

Struct ACL

struct ACL has copy, drop, store

Constants

The ACL already contains the address.

const ECONTAIN: u64 = 0;

The ACL does not contain the address.

const ENOT_CONTAIN: u64 = 1;

Function empty

Return an empty ACL.

public fun empty(): acl::ACL

Function add

Add the address to the ACL.

public fun add(acl: &mut acl::ACL, addr: address)

Function remove

Remove the address from the ACL.

public fun remove(acl: &mut acl::ACL, addr: address)

Function contains

Return true iff the ACL contains the address.

public fun contains(acl: &acl::ACL, addr: address): bool

Function assert_contains

assert! that the ACL has the address.

public fun assert_contains(acl: &acl::ACL, addr: address)