MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / scope_status

Method scope_status

nodedb/src/control/security/scope/grant.rs:201–213  ·  view source on GitHub ↗

Get the status of a specific scope grant.

(
        &self,
        scope_name: &str,
        grantee_type: &str,
        grantee_id: &str,
    )

Source from the content-addressed store, hash-verified

199
200 /// Get the status of a specific scope grant.
201 pub fn scope_status(
202 &self,
203 scope_name: &str,
204 grantee_type: &str,
205 grantee_id: &str,
206 ) -> ScopeStatus {
207 let key = grant_key(scope_name, grantee_type, grantee_id);
208 let grants = self.grants.read().unwrap_or_else(|p| p.into_inner());
209 grants
210 .get(&key)
211 .map(|g| g.status())
212 .unwrap_or(ScopeStatus::None)
213 }
214
215 /// Get the expiry timestamp of a scope grant. Returns 0 if permanent or not found.
216 pub fn scope_expires_at(&self, scope_name: &str, grantee_type: &str, grantee_id: &str) -> u64 {

Callers 1

Calls 4

grant_keyFunction · 0.85
statusMethod · 0.80
readMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected