Get the status of a specific scope grant.
(
&self,
scope_name: &str,
grantee_type: &str,
grantee_id: &str,
)
| 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 { |
no test coverage detected