From cb51022df1356235bce2c9c62fd01c6c96bca135 Mon Sep 17 00:00:00 2001 From: rvanasa Date: Wed, 4 Oct 2023 18:07:12 -0600 Subject: [PATCH] Invert condition for open RPC access --- src/auth.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth.rs b/src/auth.rs index 6d29b32d..66c3b623 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -7,8 +7,8 @@ pub fn is_authorized(auth: Auth) -> bool { } pub fn is_authorized_principal(principal: &Principal, auth: Auth) -> bool { - if auth == Auth::Rpc && METADATA.with(|m| m.borrow().get().open_rpc_access) { - return true; + if auth != Auth::Rpc && !METADATA.with(|m| m.borrow().get().open_rpc_access) { + return false; } AUTH.with(|a| { if let Some(v) = a.borrow().get(&PrincipalStorable(*principal)) {