pub struct RoleDeriver;
Expand description
Contract that implements the AccessControlRegistry role derivation logic
If a contract interfaces with AccessControlRegistry and needs to derive roles, it should inherit this contract instead of re-implementing the logic
Implementations§
Source§impl RoleDeriver
impl RoleDeriver
Sourcepub fn derive_root_role(manager: &[u8]) -> Bytes32
pub fn derive_root_role(manager: &[u8]) -> Bytes32
Derives the root role of the manager
manager
Manager address
rootRole
Root role
Sourcepub fn derive_role(admin_role: Bytes32, description: String) -> Bytes32
pub fn derive_role(admin_role: Bytes32, description: String) -> Bytes32
Derives the role using its admin role and description
This implies that roles adminned by the same role cannot have the
same description
admin_role
Admin role
description
Human-readable description of the role
Sourcepub fn derive_role_with_hash(
admin_role: Bytes32,
description_hash: Bytes32,
) -> Bytes32
pub fn derive_role_with_hash( admin_role: Bytes32, description_hash: Bytes32, ) -> Bytes32
Derives the role using its admin role and description hash
This implies that roles adminned by the same role cannot have the
same description
admin_role
Admin role
description
Hash of the human-readable description of the role
Auto Trait Implementations§
impl Freeze for RoleDeriver
impl RefUnwindSafe for RoleDeriver
impl Send for RoleDeriver
impl Sync for RoleDeriver
impl Unpin for RoleDeriver
impl UnwindSafe for RoleDeriver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more