/// Create an authorization middleware based on a meeting authorization function.
Create an authorization middleware based on a meeting authorization function.
Create an authorization middleware based on a meeting authorization function .
fn make_meeting_auth_middleware<F: 'static + Fn(&UserMeetingAuthorization) -> bool>(
    f: &'static F,
) -> Authorization {
    Authorization::new(move |user_id: Uuid| {
        Box::pin(async move {
            // Get the user meeting access authorization object.
            let auth: UserMeetingAuthorization = AuthorizationFor::get(Some(user_id)).await?;
            // Call the verification function on the access authorization object.
            (f)(&auth).then(|| ()).ok_or(TelescopeError::Forbidden)
        })
    })
}
fn make_meeting_auth_middleware < F : ' static + Fn ( & UserMeetingAuthorization ) -> bool > ( f : & ' static F , ) -> Authorization { Authorization :: new ( move | user_id : Uuid | { Box :: pin ( async move { // Get the user meeting access authorization object. let auth : UserMeetingAuthorization = AuthorizationFor :: get ( Some ( user_id ) ) . await ? ; // Call the verification function on the access authorization object. ( f ) ( & auth ) . then ( | | ( ) ) . ok_or ( TelescopeError :: Forbidden ) } ) } ) }
Create an authorization middleware based on a meeting authorization function.
Create an authorization middleware based on a meeting authorization function .
f
&'static F