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

Method has_scope

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

Check if a user (directly or via orgs) has a specific scope.

(&self, user_id: &str, org_ids: &[String], scope_name: &str)

Source from the content-addressed store, hash-verified

286
287 /// Check if a user (directly or via orgs) has a specific scope.
288 pub fn has_scope(&self, user_id: &str, org_ids: &[String], scope_name: &str) -> bool {
289 self.effective_scopes(user_id, org_ids).contains(scope_name)
290 }
291
292 /// List all grants, optionally filtered by scope name.
293 pub fn list(&self, scope_filter: Option<&str>) -> Vec<ScopeGrant> {

Callers

nothing calls this directly

Calls 2

effective_scopesMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected