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

Method check_status

nodedb/src/control/security/auth_context.rs:231–243  ·  view source on GitHub ↗

Check if the account status allows the request to proceed. Returns `Ok(())` for active accounts, `Err` with reason for blocked.

(&self)

Source from the content-addressed store, hash-verified

229 ///
230 /// Returns `Ok(())` for active accounts, `Err` with reason for blocked.
231 pub fn check_status(&self) -> crate::Result<()> {
232 match self.status {
233 AuthStatus::Active | AuthStatus::Restricted | AuthStatus::ReadOnly => Ok(()),
234 AuthStatus::Suspended => Err(crate::Error::RejectedAuthz {
235 tenant_id: self.tenant_id,
236 resource: "account suspended".into(),
237 }),
238 AuthStatus::Banned => Err(crate::Error::RejectedAuthz {
239 tenant_id: self.tenant_id,
240 resource: "account banned".into(),
241 }),
242 }
243 }
244
245 /// Check if the account allows write operations.
246 pub fn allows_write(&self) -> bool {

Callers 1

explain_permissionFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected