From e6df9be46e61bef97bab4da9530e9a6187eb84f0 Mon Sep 17 00:00:00 2001 From: Jackson Kruger Date: Fri, 27 Oct 2023 14:16:56 -0500 Subject: [PATCH] Undo rename --- src/auth/checks.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/auth/checks.rs b/src/auth/checks.rs index 1ff70e13..c8769bec 100644 --- a/src/auth/checks.rs +++ b/src/auth/checks.rs @@ -80,7 +80,7 @@ pub async fn is_authorized( pub async fn filter_authorized_projects( projects: Vec, - current_user: Option<&User>, + user_option: Option<&User>, pool: &web::Data, ) -> Result, ApiError> { let mut return_projects = Vec::new(); @@ -88,16 +88,16 @@ pub async fn filter_authorized_projects( for project in projects { if !project.inner.status.is_hidden() - || current_user.map(|x| x.role.is_mod()).unwrap_or(false) + || user_option.map(|x| x.role.is_mod()).unwrap_or(false) { return_projects.push(project.into()); - } else if current_user.is_some() { + } else if user_option.is_some() { check_projects.push(project); } } if !check_projects.is_empty() { - if let Some(user) = current_user { + if let Some(user) = user_option { let user_id: models::ids::UserId = user.id.into(); use futures::TryStreamExt;