Sorry if I that is somehow double post, but I couldn´t find anything, so I ask my noob question
I am trying to figure out if I can show something to specific user like the admin or a specific group using JavaScript? For example: if user = admin -> show that, else -> show nothing…
Yes you can. The method Discourse.User.current(); is readily available, if it returns null, the user is not logged in, otherwise, it returns a user object, that has properties for admin, and groups.
To access the groups, you might need to make a secondary call to request that information, I’m not seeing it as part of the initial user object.