From 564c26679278bf71d7e0915d286679eb08722039 Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Fri, 19 Jul 2024 11:32:01 -0500 Subject: [PATCH] This should re-allow anonymous users on systems that have that permission set. --- src/rust/lqosd/src/node_manager/auth.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/rust/lqosd/src/node_manager/auth.rs b/src/rust/lqosd/src/node_manager/auth.rs index 9f181282..958af173 100644 --- a/src/rust/lqosd/src/node_manager/auth.rs +++ b/src/rust/lqosd/src/node_manager/auth.rs @@ -80,7 +80,15 @@ pub async fn auth_layer( req.extensions_mut().insert(login_result); Ok(next.run(req).await) } - LoginResult::Denied => Err(Html(BOUNCE)), + LoginResult::Denied => { + let users = WebUsers::load_or_create().unwrap(); + if users.do_we_allow_anonymous() { + req.extensions_mut().insert(LoginResult::ReadOnly); + Ok(next.run(req).await) + } else { + Err(Html(BOUNCE)) + } + }, }; } Err(Html(BOUNCE))