[discourse-mozillians] Get members of nda group from API


(Leo McArdle) #1

Unfortunately, v2 of the mozillians api doesn’t expose the groups a user is in the users method. However, the users method does still have a group parameter.

This means, in order to establish whether a user is in the nda group, we must query https://mozillians.org/api/v2/users/?email=user@example.com&group=nda

If we have a count of 1, then the user with that email is in the nda group, otherwise the user isn’t in the nda group (or we don’t have an api key with high enough privs to see if they are).

If the user is in the nda group, they should be added to the mozillians_nda group in Discourse, if they aren’t they should be removed from it.


(Safwan Rahman) #2

Yap. A Bug has been filled for the group name in user endpoint! Bug 1216794

Hope it will be fixed by any of the Devs or any of the community Webdev


(Leo McArdle) #3

Thanks for that, that bug also alerted me to the fact I should learn to read better, because it turns out the API does allow you to query the users endpoint with a particular group.


(Leo McArdle) #4

[Completed]


(Leo McArdle) #5

(Rubén Martín) #6

Was this integrated in the stage server?


(Leo McArdle) #7

I think it was, although staging looks like its broken at the moment.

I should find some time this week to spin up a local instance and test it out again after all this time.


(Rubén Martín) #8

Any updates/help you need? :wink:


(Leo McArdle) #9

I need a time machine. (It’s on my todo list, honest!)


(Leo McArdle) #10

(Leo McArdle) #11