Automatically map email domains to groups / permission sets?

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)?

3 Likes

This was a nice feature of Zendesk.

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

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

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

2 Likes

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

9 Likes

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?

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

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

1 Like

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