pub struct McpPermissionChecker { /* private fields */ }
Expand description
MCP Permission Checker
Implementations§
Source§impl McpPermissionChecker
impl McpPermissionChecker
Sourcepub fn new(config: PermissionConfig) -> Self
pub fn new(config: PermissionConfig) -> Self
Create a new permission checker
Sourcepub fn can_use_tool(&self, auth_context: &AuthContext, tool_name: &str) -> bool
pub fn can_use_tool(&self, auth_context: &AuthContext, tool_name: &str) -> bool
Check if a user can use a specific tool
Sourcepub fn can_access_resource(
&self,
auth_context: &AuthContext,
resource_uri: &str,
) -> bool
pub fn can_access_resource( &self, auth_context: &AuthContext, resource_uri: &str, ) -> bool
Check if a user can access a specific resource
Sourcepub fn can_use_prompt(
&self,
auth_context: &AuthContext,
prompt_name: &str,
) -> bool
pub fn can_use_prompt( &self, auth_context: &AuthContext, prompt_name: &str, ) -> bool
Check if a user can use a specific prompt
Sourcepub fn can_subscribe(
&self,
auth_context: &AuthContext,
resource_uri: &str,
) -> bool
pub fn can_subscribe( &self, auth_context: &AuthContext, resource_uri: &str, ) -> bool
Check if a user can subscribe to a resource
Sourcepub fn can_use_method(&self, auth_context: &AuthContext, method: &str) -> bool
pub fn can_use_method(&self, auth_context: &AuthContext, method: &str) -> bool
Check method-level permissions
Sourcepub fn validate_config(&self) -> Result<(), PermissionError>
pub fn validate_config(&self) -> Result<(), PermissionError>
Validate permission configuration
Auto Trait Implementations§
impl Freeze for McpPermissionChecker
impl RefUnwindSafe for McpPermissionChecker
impl Send for McpPermissionChecker
impl Sync for McpPermissionChecker
impl Unpin for McpPermissionChecker
impl UnwindSafe for McpPermissionChecker
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