Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Undo rename
Browse files Browse the repository at this point in the history
  • Loading branch information
OmegaJak committed Oct 27, 2023
1 parent 5530a87 commit e6df9be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/auth/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,24 @@ pub async fn is_authorized(

pub async fn filter_authorized_projects(
projects: Vec<QueryProject>,
current_user: Option<&User>,
user_option: Option<&User>,
pool: &web::Data<PgPool>,
) -> Result<Vec<crate::models::projects::Project>, ApiError> {
let mut return_projects = Vec::new();
let mut check_projects = Vec::new();

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;
Expand Down

0 comments on commit e6df9be

Please sign in to comment.