Getting user's custom groups problems


(Steven Slade) #1

Discourse.User.current() works thoughout Discourse.

Discourse.User.current().custom_groups only works in certain areas (works on profile, does not work while inside a topic).

Why is this and how can I access a user’s custom groups throughout Discourse?

(Rafael dos Santos Silva) #2

If you are creating a plugin you can add almost anything to the models, trough serializer customization.

Many plugins already do this, mainly using custom fields, but I don’t see why the same thing wouldn’t work with custom groups.

(Steven Slade) #3

Thanks for the information @Falco. You wouldn’t happen to know of a post on meta about serializer customization, would you? I searched it and couldn’t find anything immediately relevant. Or, would you be able to give me an example of what you mean?

(Rafael dos Santos Silva) #4