MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / is_approved

Method is_approved

crates/opencode-permission/src/engine.rs:85–95  ·  view source on GitHub ↗
(
        &self,
        session_id: &str,
        pattern: Option<&Pattern>,
        permission_type: &str,
    )

Source from the content-addressed store, hash-verified

83 }
84
85 pub fn is_approved(
86 &self,
87 session_id: &str,
88 pattern: Option<&Pattern>,
89 permission_type: &str,
90 ) -> bool {
91 let empty = HashMap::new();
92 let approved_for_session = self.approved.get(session_id).unwrap_or(&empty);
93 let keys = Self::to_keys(pattern, permission_type);
94 Self::covered(&keys, approved_for_session)
95 }
96
97 pub async fn ask(&mut self, info: PermissionInfo) -> Result<(), PermissionError> {
98 let session_id = info.session_id.clone();

Callers 1

askMethod · 0.80

Calls 2

newFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected