pub struct UserPermissions {
pub computed_permissions: HashMap<String, AccessResult>,
pub last_updated: Timestamp,
}Expand description
Cached permissions for a user with last updated timestamp.
Fields§
§computed_permissions: HashMap<String, AccessResult>The computed permission results
last_updated: TimestampWhen the permissions were last updated
Implementations§
Source§impl UserPermissions
impl UserPermissions
Sourcepub fn new(permissions: HashMap<String, AccessResult>) -> Self
pub fn new(permissions: HashMap<String, AccessResult>) -> Self
Create new user permissions cache
Sourcepub fn is_expired(&self, ttl_seconds: u64) -> bool
pub fn is_expired(&self, ttl_seconds: u64) -> bool
Check if the cache entry is expired based on TTL
Trait Implementations§
Source§impl Clone for UserPermissions
impl Clone for UserPermissions
Auto Trait Implementations§
impl Forget for UserPermissions
impl Freeze for UserPermissions
impl Move for UserPermissions
impl RefUnwindSafe for UserPermissions
impl Send for UserPermissions
impl Sync for UserPermissions
impl Unpin for UserPermissions
impl UnsafeUnpin for UserPermissions
impl UnwindSafe for UserPermissions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more