You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Internal version of [`grant_role`] without access control. Returns true if the role was newly granted.
129
+
/// Internal version of [`grant_role`] without access control. Returns true if the role was newly
130
+
/// granted.
129
131
///
130
132
/// Emits a [`RoleGranted`] event.
131
133
///
@@ -188,7 +190,8 @@ pub(crate) fn _grant_role(
188
190
Ok(new_member)
189
191
}
190
192
191
-
// Internal version of [`revoke_role`] without access control. This logic is also used by {renounceRole}. Returns true if the role was previously granted.
193
+
// Internal version of [`revoke_role`] without access control. This logic is also used by
194
+
// {renounceRole}. Returns true if the role was previously granted.
192
195
///
193
196
/// Emits a [`RoleRevoked`] event if the account had the role.
Copy file name to clipboardExpand all lines: cosmwasm/cw-manager/src/event.rs
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,9 @@ impl Into<Event> for RoleLabel<'_> {
101
101
/// Emitted when `account` is granted `roleId`.
102
102
///
103
103
/// NOTE: The meaning of the `since` argument depends on the `newMember` argument.
104
-
/// If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role, otherwise it indicates the execution delay for this account and roleId is updated.
104
+
/// If the role is granted to a new member, the `since` argument indicates when the account becomes
105
+
/// a member of the role, otherwise it indicates the execution delay for this account and roleId is
Copy file name to clipboardExpand all lines: cosmwasm/cw-manager/src/lib.rs
+21-15Lines changed: 21 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -2,35 +2,41 @@
2
2
//!
3
3
//! AccessManager is a central contract to store the permissions of a system.
4
4
//!
5
-
//! A smart contract under the control of an AccessManager instance is known as a target, and will inherit from the
6
-
//! {AccessManaged} contract, be connected to this contract as its manager and implement the {AccessManaged-restricted}
7
-
//! modifier on a set of functions selected to be permissioned. Note that any function without this setup won't be
8
-
//! effectively restricted.
5
+
//! A smart contract under the control of an AccessManager instance is known as a target, and will
6
+
//! inherit from the {AccessManaged} contract, be connected to this contract as its manager and
7
+
//! implement the {AccessManaged-restricted} modifier on a set of functions selected to be
8
+
//! permissioned. Note that any function without this setup won't be effectively restricted.
9
9
//!
10
-
//! The restriction rules for such functions are defined in terms of "roles" identified by a [`RoleId`] and scoped
11
-
//! by target ([`Addr`][cosmwasm_std::Addr]) and function selectors ([`Selector`][crate::types::Selector]). These roles are stored in this contract and can be
12
-
//! configured by admins ([`RoleId::ADMIN_ROLE`] members) after a delay (see [`QueryMsg::GetTargetAdminDelay`]).
10
+
//! The restriction rules for such functions are defined in terms of "roles" identified by a
11
+
//! [`RoleId`] and scoped by target ([`Addr`][cosmwasm_std::Addr]) and function selectors
12
+
//! ([`Selector`][crate::types::Selector]). These roles are stored in this contract and can be
13
+
//! configured by admins ([`RoleId::ADMIN_ROLE`] members) after a delay (see
14
+
//! [`QueryMsg::GetTargetAdminDelay`]).
13
15
//!
14
16
//! For each target contract, admins can configure the following without any delay:
15
17
//!
16
18
//! * The target's {AccessManaged-authority} via [`ExecuteMsg::UpdateAuthority`].
17
19
//! * Close or open a target via [`ExecuteMsg::SetTargetClosed`] keeping the permissions intact.
18
-
//! * The roles that are allowed (or disallowed) to call a given function (identified by its selector) through [`ExecuteMsg::SetTargetAdminDelay`].
20
+
//! * The roles that are allowed (or disallowed) to call a given function (identified by its
21
+
//! selector) through [`ExecuteMsg::SetTargetAdminDelay`].
19
22
//!
20
-
//! By default every address is member of the [`RoleId::PUBLIC_ROLE`] and every target function is restricted to the [`RoleId::ADMIN_ROLE`] until configured otherwise.
21
-
//! Additionally, each role has the following configuration options restricted to this manager's admins:
23
+
//! By default every address is member of the [`RoleId::PUBLIC_ROLE`] and every target function is
24
+
//! restricted to the [`RoleId::ADMIN_ROLE`] until configured otherwise. Additionally, each role has
25
+
//! the following configuration options restricted to this manager's admins:
22
26
//!
23
27
//! * A role's admin role via [`ExecuteMsg::SetRoleAdmin`] who can grant or revoke roles.
24
28
//! * A role's guardian role via [`ExecuteMsg::SetRoleGuardian`] who's allowed to cancel operations.
25
-
//! * A delay in which a role takes effect after being granted through [`ExecuteMsg::SetGrantDelay`].
29
+
//! * A delay in which a role takes effect after being granted through
30
+
//! [`ExecuteMsg::SetGrantDelay`].
26
31
//! * A delay of any target's admin action via [`ExecuteMsg::SetTargetAdminDelay`].
27
32
//! * A role label for discoverability purposes with [`ExecuteMsg::LabelRole`].
28
33
//!
29
-
//! Any account can be added and removed into any number of these roles by using the [`ExecuteMsg::GrantRole`] and [`ExecuteMsg::RevokeRole`] functions
30
-
//! restricted to each role's admin (see [`QueryMsg::GetRoleAdmin`]).
34
+
//! Any account can be added and removed into any number of these roles by using the
35
+
//! [`ExecuteMsg::GrantRole`] and [`ExecuteMsg::RevokeRole`] functions restricted to each role's
36
+
//! admin (see [`QueryMsg::GetRoleAdmin`]).
31
37
//!
32
-
//! Since all the permissions of the managed system can be modified by the admins of this instance, it is expected that
33
-
//! they will be highly secured (e.g., a multisig or a well-configured DAO).
38
+
//! Since all the permissions of the managed system can be modified by the admins of this instance,
39
+
//! it is expected that they will be highly secured (e.g., a multisig or a well-configured DAO).
0 commit comments