You've already forked AstralRinth
forked from didirus/AstralRinth
Add report + moderation messaging (#567)
* Add report + moderation messaging * Add system messages * address review comments * Remove ds store * Update messaging * run prep --------- Co-authored-by: Geometrically <geometrically@Jais-MacBook-Pro.local>
This commit is contained in:
@@ -117,21 +117,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn check_is_admin_from_headers<'a, 'b, E>(
|
||||
headers: &HeaderMap,
|
||||
executor: E,
|
||||
) -> Result<User, AuthenticationError>
|
||||
where
|
||||
E: sqlx::Executor<'a, Database = sqlx::Postgres>,
|
||||
{
|
||||
let user = get_user_from_headers(headers, executor).await?;
|
||||
|
||||
match user.role {
|
||||
Role::Admin => Ok(user),
|
||||
_ => Err(AuthenticationError::InvalidCredentials),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn is_authorized(
|
||||
project_data: &Project,
|
||||
user_option: &Option<User>,
|
||||
|
||||
Reference in New Issue
Block a user