From b9c322abbfb258742fcb56c8335e1f39a592d457 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Tue, 5 Nov 2024 10:09:46 +0100 Subject: [PATCH] Improve auth validation code --- IM/InfrastructureList.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/IM/InfrastructureList.py b/IM/InfrastructureList.py index c5c85d4b..c9b1d99c 100644 --- a/IM/InfrastructureList.py +++ b/IM/InfrastructureList.py @@ -254,6 +254,8 @@ def _gen_where_from_auth(auth): like = "" if auth: for elem in auth.getAuthInfo('InfrastructureManager'): + if elem.get("admin"): + return "" if elem.get("username"): if like: like += " or " @@ -266,6 +268,8 @@ def _gen_filter_from_auth(auth): like = "" if auth: for elem in auth.getAuthInfo('InfrastructureManager'): + if elem.get("admin"): + return {} if elem.get("username"): if like: like += "|"