pub trait RequestAuthExt {
    // Required methods
    fn user_session(&self) -> Option<&UserSession>;
    fn user_id(&self) -> Option<&str>;
    fn is_authenticated(&self) -> bool;
    fn has_permission(&self, permission: &str) -> bool;
    fn has_role(&self, role: &str) -> bool;
}Expand description
Extension trait to add authentication information to requests
Required Methods§
Sourcefn user_session(&self) -> Option<&UserSession>
 
fn user_session(&self) -> Option<&UserSession>
Get the authenticated user session from the request
Sourcefn is_authenticated(&self) -> bool
 
fn is_authenticated(&self) -> bool
Check if the request is authenticated
Sourcefn has_permission(&self, permission: &str) -> bool
 
fn has_permission(&self, permission: &str) -> bool
Check if the user has a specific permission