/**
 * Return true if the session user id is matching the param account_id
 * If no account_id is provided, try with the id field
 */
Return true if the session user id is matching the param account_id
If no account_id is provided, try with the id field
Return true if the session user id is matching the param account_id If no account_id is provided try with the id field
fn is_account(req: &Request<Config>) -> bool {
    let session = match req.extensions().get::<Session>() {
        Some(s) => s,
        None => return false
    };
    match req.param("account_id") {
        Some(id) => return id.to_string() == session.id,
        None => {}
    }
    match req.param("id") {
        Some(id) => return id.to_string() == session.id,
        None => return false
    }
}
fn is_account ( req : & Request < Config > ) -> bool { let session = match req . extensions ( ) . get :: < Session > ( ) { Some ( s ) => s , None => return false } ; match req . param ( " " ) { Some ( id ) => return id . to_string ( ) == session . id , None => { } } match req . param ( " " ) { Some ( id ) => return id . to_string ( ) == session . id , None => return false } }
Return true if the session user id is matching the param account_id
 If no account_id is provided, try with the id field
Return true if the session user id is matching the param account_id If no account_id is provided try with the id field
req
&Request<Config>
<not_specific>