pub struct RoleDefinition {
pub id: String,
pub name: String,
pub profile: Option<RoleProfile>,
pub description: Option<String>,
pub workspace: Option<WorkspaceConfig>,
pub capabilities: Vec<String>,
pub restrictions: Vec<Restriction>,
pub model: Option<ModelConfig>,
}Expand description
Role definition in a workflow
Fields§
§id: StringRole identifier
name: StringDisplay name
profile: Option<RoleProfile>Base profile
description: Option<String>Description
workspace: Option<WorkspaceConfig>Workspace configuration
capabilities: Vec<String>Explicit capabilities (overrides profile)
restrictions: Vec<Restriction>Explicit restrictions (overrides profile)
model: Option<ModelConfig>Model configuration
Implementations§
Source§impl RoleDefinition
impl RoleDefinition
Sourcepub fn effective_capabilities(&self) -> HashSet<Capability>
pub fn effective_capabilities(&self) -> HashSet<Capability>
Get effective capabilities (profile + overrides)
Sourcepub fn effective_restrictions(&self) -> Vec<Restriction>
pub fn effective_restrictions(&self) -> Vec<Restriction>
Get effective restrictions (profile + overrides)
Sourcepub fn has_capability(&self, cap: &Capability) -> bool
pub fn has_capability(&self, cap: &Capability) -> bool
Check if role has a capability
Sourcepub fn is_restricted(&self, action: &str) -> bool
pub fn is_restricted(&self, action: &str) -> bool
Check if role is restricted from an action
Trait Implementations§
Source§impl Clone for RoleDefinition
impl Clone for RoleDefinition
Source§fn clone(&self) -> RoleDefinition
fn clone(&self) -> RoleDefinition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RoleDefinition
impl Debug for RoleDefinition
Source§impl<'de> Deserialize<'de> for RoleDefinition
impl<'de> Deserialize<'de> for RoleDefinition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RoleDefinition
impl RefUnwindSafe for RoleDefinition
impl Send for RoleDefinition
impl Sync for RoleDefinition
impl Unpin for RoleDefinition
impl UnsafeUnpin for RoleDefinition
impl UnwindSafe for RoleDefinition
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