             AuthenticationUtil$RunAsWork]))
 
 ; TODO memoize the result
+;;
 (defn admin
   "Returns the current Administrator user name."
   []
   (AuthenticationUtil/getAdminUserName))
+
+(defn admin
+  "Returns the current Administrator user name."
+  []
+  (AuthenticationUtil/getSystemUserName))
 
 (defmacro run-as
   "Runs the provided form while impersonating the given user.

  [& f]
  `(run-as (admin) ~@f))

(defn whoami
  "Returns the currently valid user name"
  []

  scope of the authorisation context (which is probably not what's intended)."
  [user & f]
  `(let [work# (reify AuthenticationUtil$RunAsWork
                 (~'doWork [~'this]
                   ~@f))]
     (AuthenticationUtil/runAs work# ~user)))

(defmacro run-as-fn
