pub struct PermissionChecker { /* private fields */ }Expand description
Checks permissions for tool operations based on configured rules.
Implementations§
Source§impl PermissionChecker
impl PermissionChecker
Sourcepub fn from_config(config: &PermissionsConfig) -> Self
pub fn from_config(config: &PermissionsConfig) -> Self
Create from configuration.
Sourcepub fn allow_all() -> Self
pub fn allow_all() -> Self
Create a checker that allows everything (for testing or bypass mode).
Sourcepub fn check(&self, tool_name: &str, input: &Value) -> PermissionDecision
pub fn check(&self, tool_name: &str, input: &Value) -> PermissionDecision
Check whether a tool operation is permitted.
Evaluates in order: protected paths, explicit rules, default mode. The first match wins.
Sourcepub fn check_read(&self, tool_name: &str, input: &Value) -> PermissionDecision
pub fn check_read(&self, tool_name: &str, input: &Value) -> PermissionDecision
Check for read-only operations (always allowed).
Auto Trait Implementations§
impl Freeze for PermissionChecker
impl RefUnwindSafe for PermissionChecker
impl Send for PermissionChecker
impl Sync for PermissionChecker
impl Unpin for PermissionChecker
impl UnsafeUnpin for PermissionChecker
impl UnwindSafe for PermissionChecker
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