Automatically map email domains to groups / permission sets?


(Josh Siegel) #1

We are getting started with Discourse at Looker and we plan to use the same forum for employee-only posts as we do for the general public. Until now I’ve been making every Looker employee who signs up a moderator or admin so they can see the Staff-only category (I realize I could make an employee group too/instead).

Is there a more programmatic way to do this (map @looker.com email address to a trust level / group)?


(Dave McClure) #2

This was a nice feature of Zendesk.

Don’t think there is any built in way yo do this in discourse at the moment.


(Sam Saffron) #3

its a feature we would accept into core, a quick and dirty solution is to monkey patch the User class in a plugin and wire the logic there after_create


(Kevin P. Fleming) #4

We’re going to want this too, eventually. If someone wants to work on a plugin, I’ll give whatever help I can!


(Jeff Atwood) #5

OK, this is in, courtesy of @zogstrip – you can edit it from Admin, Groups, Custom.


Permission set for custom group
Does automatic group membership based on email domain work when user changes email?
Group By domain
(Tobias Eigen) #6

this is awesome - thanks @zogstrip!

question: if I add someone manually to this group whose email is not in that domain AND put the email domain in that field, will they remain? Or will your code only allow people with that domain in their email to be in the group?


(Kane York) #7

Looks like it only adds on signup (unless you check the box), and doesn’t remove anyone.


(Régis Hanol) #8

@riking is right, it only adds users to a group, it never removes people from the group.


(Jeff Atwood) #9

This topic was automatically closed after 3 days. New replies are no longer allowed.