Struct dao::modules::access_control::AccessControl
source · pub struct AccessControl {
pub owner: Owner,
pub whitelist: Whitelist,
}
Expand description
A AccessControl module storage definition.
Fields§
§owner: Owner
§whitelist: Whitelist
Implementations§
source§impl AccessControl
impl AccessControl
sourcepub fn propose_new_owner(&mut self, owner: Address)
pub fn propose_new_owner(&mut self, owner: Address)
Proposes a change of ownership of the contract. Owner will be changed if accepted by propsed new owner. Only the current owner is permited to call this method.
§Errors
Throws NotAnOwner
if caller
is not the current owner.
sourcepub fn accept_new_owner(&mut self)
pub fn accept_new_owner(&mut self)
Accepts the new owner proposition. This can be called only by the proposed owner.
§Events
Emits OwnerChanged
,
AddedToWhitelist
events.
sourcepub fn add_to_whitelist(&mut self, address: Address)
pub fn add_to_whitelist(&mut self, address: Address)
Adds a new address to the whitelist.
§Errors
Throws NotAnOwner
if the caller
is not the current owner.
§Events
Emits AddedToWhitelist
event.
sourcepub fn remove_from_whitelist(&mut self, address: Address)
pub fn remove_from_whitelist(&mut self, address: Address)
Removes the address
from the whitelist.
§Errors
Throws NotAnOwner
if caller
is not the current owner.
§Events
It emits RemovedFromWhitelist
sourcepub fn is_whitelisted(&self, address: Address) -> bool
pub fn is_whitelisted(&self, address: Address) -> bool
Checks whether the given address is added to the whitelist.
See Whitelist
.
sourcepub fn ensure_whitelisted(&self)
pub fn ensure_whitelisted(&self)
Verifies whether the current caller address is added to the whitelist.
Trait Implementations§
source§impl Clone for AccessControl
impl Clone for AccessControl
source§fn clone(&self) -> AccessControl
fn clone(&self) -> AccessControl
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more