pub struct Resolved {
pub has_app_acl: bool,
pub allowed_commands: BTreeMap<String, Vec<ResolvedCommand>>,
pub denied_commands: BTreeMap<String, Vec<ResolvedCommand>>,
pub command_scope: BTreeMap<ScopeKey, ResolvedScope>,
pub global_scope: BTreeMap<String, ResolvedScope>,
}Expand description
Resolved access control list.
Fields§
§has_app_acl: boolIf we should check the ACL for the app commands
allowed_commands: BTreeMap<String, Vec<ResolvedCommand>>The commands that are allowed. Map each command with its context to a ResolvedCommand.
denied_commands: BTreeMap<String, Vec<ResolvedCommand>>The commands that are denied. Map each command with its context to a ResolvedCommand.
command_scope: BTreeMap<ScopeKey, ResolvedScope>The store of scopes referenced by a ResolvedCommand.
global_scope: BTreeMap<String, ResolvedScope>The global scope.
Implementations§
Source§impl Resolved
impl Resolved
Sourcepub fn resolve(
acl: &BTreeMap<String, Manifest>,
capabilities: BTreeMap<String, Capability>,
target: Target,
) -> Result<Self, Error>
pub fn resolve( acl: &BTreeMap<String, Manifest>, capabilities: BTreeMap<String, Capability>, target: Target, ) -> Result<Self, Error>
Resolves the ACL for the given plugin permissions and app capabilities.
Command scope ids are assigned sequentially starting from 1.
See Self::resolve_with_base_scope_id to assign them past a different id.
Sourcepub fn resolve_with_base_scope_id(
acl: &BTreeMap<String, Manifest>,
capabilities: BTreeMap<String, Capability>,
target: Target,
base_scope_id: ScopeKey,
) -> Result<Self, Error>
pub fn resolve_with_base_scope_id( acl: &BTreeMap<String, Manifest>, capabilities: BTreeMap<String, Capability>, target: Target, base_scope_id: ScopeKey, ) -> Result<Self, Error>
Resolves the ACL for the given plugin permissions and app capabilities,
assigning command scope ids sequentially after base_scope_id (starting from base_scope_id + 1).
This is useful when the result is merged into an already resolved ACL:
pass its highest scope id so the new Self::command_scope keys do not collide.