Get user info in backend

I am super new to Metabase codebase and have couple questions:

  1. In the backend code at any given place (e.g. database.clj) how do I get info about currently logged in user (id, first name, last name, custom attributes etc.)

  2. I see quite a few thing in the project especially related to repl/debugging - is there a guide or set of recommendations how to effectively debug Metabase project?

Thanks!

Hi @ygalanter

  1. https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#get-apiuserid or /api/user/current ?
  2. Our developers guide is a little outdated, but our wiki has more updated sections.

Thanks for the prompt response! And the wiki is really helpful. Regarding user, since I need this info in the backend code, not fronted, I was hoping something like session with user info exists. Or can I call user/current from the backend code too?

@ygalanter Look in src/metabase/api/ for the corresponding backend code that runs the API.

That did it. Thank you so much!