Check the time-bound status of this grant.
(&self)
| 55 | impl ScopeGrant { |
| 56 | /// Check the time-bound status of this grant. |
| 57 | pub fn status(&self) -> ScopeStatus { |
| 58 | if self.expires_at == 0 { |
| 59 | return ScopeStatus::Active; // No expiry = permanent. |
| 60 | } |
| 61 | let now = now_secs(); |
| 62 | if now < self.expires_at { |
| 63 | ScopeStatus::Active |
| 64 | } else if now < self.expires_at + self.grace_period_secs { |
| 65 | ScopeStatus::Grace |
| 66 | } else { |
| 67 | ScopeStatus::Expired |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | /// Check if this grant is still effective (active or in grace period). |
| 72 | pub fn is_effective(&self) -> bool { |