pub struct Guard { /* private fields */ }Expand description
Centralized runtime validation for the Trust Model.
Implementations§
Source§impl Guard
impl Guard
Sourcepub fn with_gates(
project: &Project,
gates: BTreeMap<String, GateConfig>,
) -> Self
pub fn with_gates( project: &Project, gates: BTreeMap<String, GateConfig>, ) -> Self
Create a Guard with gates.
Sourcepub fn load(root: &Path) -> Result<Self, JoyError>
pub fn load(root: &Path) -> Result<Self, JoyError>
Load project.yaml and create a Guard, including gate config.
Sourcepub fn gates(&self) -> &BTreeMap<String, GateConfig>
pub fn gates(&self) -> &BTreeMap<String, GateConfig>
Get the configured gates (for display in joy project).
Sourcepub fn check(&self, action: &Action, identity: &Identity) -> Verdict
pub fn check(&self, action: &Action, identity: &Identity) -> Verdict
Check whether an action is allowed for the given identity.
Sourcepub fn is_last_manager(&self, member_id: &str) -> bool
pub fn is_last_manager(&self, member_id: &str) -> bool
Check if removing a member would leave no one with manage capability.
Auto Trait Implementations§
impl Freeze for Guard
impl RefUnwindSafe for Guard
impl Send for Guard
impl Sync for Guard
impl Unpin for Guard
impl UnsafeUnpin for Guard
impl UnwindSafe for Guard
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