From bbbf73d62bd4391e1b0f9fb7aab0aa60ce6782c9 Mon Sep 17 00:00:00 2001
From: Case Nelson <case@metabase.com>
Date: Wed, 19 Oct 2022 22:33:29 -0600
Subject: [PATCH] Properly check if api/*current-user* is bound (#26028)

When I moved tests from using an api to testing function calls more
directly, it exposed this faulty superuser check that was expected to be
skipped. Both passing in isolation but together they caused the moved
tests to fail.
---
 src/metabase/actions.clj | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/metabase/actions.clj b/src/metabase/actions.clj
index e16e185e102..ded6241a4f3 100644
--- a/src/metabase/actions.clj
+++ b/src/metabase/actions.clj
@@ -183,7 +183,7 @@
         ;; TODO -- need to check permissions once we have Actions-specific perms in place. For now just make sure the
         ;; current User is an admin. This check is only done if [[api/*current-user*]] is bound (which will always be
         ;; the case when invoked from an API endpoint) to make Actions testable separately from the API endpoints.
-        (when api/*current-user*
+        (when @api/*current-user*
           (api/check-superuser))
         ;; Ok, now we can hand off to [[perform-action!*]]
         (perform-action!* driver action db arg-map)))))
-- 
GitLab