Struct DummyAccess

Source
pub struct DummyAccess<Address: AsRef<[u8]> + Zero + Default + PartialEq> { /* private fields */ }

Trait Implementations§

Source§

impl<Address> AccessControlRegistry for DummyAccess<Address>
where Address: AsRef<[u8]> + Zero + Default + PartialEq,

Source§

fn has_role(&self, _role: &Bytes32, _who: &Self::Address) -> bool

Checks if user has a particular role role The role to check who The address to check
Source§

fn grant_role( &mut self, _role: &Bytes32, _who: &Self::Address, ) -> Result<(), Error>

Grant role for the user role The role to grant who The address to grant role
Source§

fn get_role_admin(&self, _role: &Bytes32) -> Option<Bytes32>

Get the admin role of role role The role to check
Source§

fn set_role_admin( &mut self, _role: &Bytes32, _role_admin: Bytes32, ) -> Result<(), Error>

Set the role admin for a role role The role to grant role_admin The role admin
Source§

fn renounce_role( &mut self, _role: &Bytes32, _account: &Self::Address, ) -> Result<(), Error>

Called by the account to renounce the role Override to disallow managers to renounce their root roles. role Role to be renounced account Account to renounce the role
Source§

fn revoke_role( &mut self, _role: &Bytes32, _account: &Self::Address, ) -> Result<(), Error>

Called by the role admin to renounce the role Override to disallow managers to renounce their root roles. role Role to be renounced account Account to renounce the role
Source§

const DEFAULT_ADMIN_ROLE: Bytes32 = _

Default admin role, align with Openzepplin’s definition
Source§

const NAME_SETTER_ROLE_DESCRIPTION: &'static str = "Name setter"

Source§

const UNLIMITED_READER_ROLE_DESCRIPTION: &'static str = "Unlimited reader"

Source§

fn find_static_role(&self, role: StaticRole) -> Bytes32

Find the role by its name. Not in the original solidity contract Just for making it work in Rust
Source§

fn only_role( &self, role: &Bytes32, msg_sender: &Self::Address, ) -> Result<(), Error>

Checks that an account has a specific role. Reverts with a standardized message including the required role. role The role to check msg_sender The address to check
Source§

fn initialize_manager(&mut self, manager: &Self::Address) -> Result<(), Error>

Initializes the manager by initializing its root role and granting it to them Anyone can initialize a manager. An uninitialized manager attempting to initialize a role will be initialized automatically. Once a manager is initialized, subsequent initializations have no effect. manager Manager address to be initialized
Source§

fn initialize_role_and_grant_to_sender( &mut self, admin_role: Bytes32, description: String, msg_sender: &Self::Address, ) -> Result<Bytes32, Error>

Initializes a role by setting its admin role and grants it to the sender If the sender should not have the initialized role, they should explicitly renounce it after initializing it. Once a role is initialized, subsequent initializations have no effect other than granting the role to the sender. The sender must be a member of admin_role. admin_role value is not validated because the sender cannot have the bytes32(0) role. If the sender is an uninitialized manager that is initializing a role directly under their root role, manager initialization will happen automatically, which will grant the sender admin_role and allow them to initialize the role. admin_role Admin role to be assigned to the initialized role description Human-readable description of the initialized role msg_sender The message sender address
Source§

fn derive_admin_role(&self, manager: &Self::Address) -> Bytes32

Derives the admin role of the manager manager Manager address
Source§

fn derive_root_role(&self, manager: &Self::Address) -> Bytes32

Derives the root role of the manager manager Manager address
Source§

fn derive_role(&self, admin_role: Bytes32, description: String) -> Bytes32

Derives the role using its admin role and description Read more
Source§

impl<Address> AccessControlRegistryAdminnedWithManager for DummyAccess<Address>
where Address: AsRef<[u8]> + Zero + Default + PartialEq,

Source§

type Address = Address

Source§

fn manager(&self) -> &Self::Address

Get the manager of this registry
Source§

fn admin_role_description(&self) -> String

Admin role description
Source§

fn admin_role_description_hash(&self) -> Bytes32

Admin role description hash
Source§

fn admin_role(&self) -> Bytes32

Admin role
Source§

impl<Address: AsRef<[u8]> + Zero + Default + PartialEq> Default for DummyAccess<Address>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<Address> Freeze for DummyAccess<Address>
where Address: Freeze,

§

impl<Address> RefUnwindSafe for DummyAccess<Address>
where Address: RefUnwindSafe,

§

impl<Address> Send for DummyAccess<Address>
where Address: Send,

§

impl<Address> Sync for DummyAccess<Address>
where Address: Sync,

§

impl<Address> Unpin for DummyAccess<Address>
where Address: Unpin,

§

impl<Address> UnwindSafe for DummyAccess<Address>
where Address: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.