MCPcopy Create free account
hub / github.com/AI45Lab/Code / get_effective_policy

Method get_effective_policy

core/src/permissions/manager.rs:75–79  ·  view source on GitHub ↗

Get the effective policy for a session Session policy takes precedence over global policy for matching rules. If no session policy exists, uses global policy.

(&self, session_id: &str)

Source from the content-addressed store, hash-verified

73 /// Session policy takes precedence over global policy for matching rules.
74 /// If no session policy exists, uses global policy.
75 pub fn get_effective_policy(&self, session_id: &str) -> &PermissionPolicy {
76 self.session_policies
77 .get(session_id)
78 .unwrap_or(&self.global_policy)
79 }
80
81 /// Check permission for a tool invocation in a session
82 pub fn check(

Callers 2

checkMethod · 0.80

Calls 1

getMethod · 0.45

Tested by 1