Skip to content
Snippets Groups Projects
Commit e1010d4d authored by Cam Saul's avatar Cam Saul
Browse files

Make sure with-test-user macro causes *is-superuser?* to be bound correctly

parent 14dd7d8b
Branches
Tags
No related merge requests found
......@@ -166,7 +166,10 @@
(defn do-with-test-user
"Call `f` with various `metabase.api.common` dynamic vars bound to the test User named by `user-kwd`."
[user-kwd f]
((middleware/bind-current-user (fn [_] (f))) {:metabase-user-id (user->id user-kwd)}))
((middleware/bind-current-user (fn [_] (f)))
(let [user-id (user->id user-kwd)]
{:metabase-user-id user-id
:is-superuser? (db/select-one-field :is_superuser User :id user-id)})))
(defmacro with-test-user
"Call `body` with various `metabase.api.common` dynamic vars like `*current-user*` bound to the test User named by
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment