Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
;=> auth-context
#<Delay@2cca1df3: #<JiraAuthenticationContextImpl com.atlassian.jira.security.JiraAuthenticationContextImpl@142a3945>>
;=> (defmacro as-user [user & body]
`(let [old-user# (.getUser @auth-context ~user)]
(.setUser @auth-context ~user)
(try
~@body
(finally (.setUser @auth-context old-user#)))))
#'com.indeed.jira-releng-plugin.jira/as-user
;=> (macroexpand '(as-user FOO (bar baz)))
(let* [old-user__942__auto__ (.getUser (clojure.core/deref clojure.core/auth-context) FOO)] (.setUser (clojure.core/deref clojure.core/auth-context) FOO) (try (bar baz) (finally (.setUser (clojure.core/deref clojure.core/auth-context) old│
-user__942__auto__))))
;;; ...the clojure.core/auth-context references are the immediate issue here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.