Check if the account status allows the request to proceed. Returns `Ok(())` for active accounts, `Err` with reason for blocked.
(&self)
| 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 { |
no outgoing calls
no test coverage detected