Automatically map email domains to groups / permission sets?

AI-generated summary

The discussion revolves around automatically mapping email domains to groups or permission sets in Discourse. joshsiegel inquired about a more programmatic way to assign users with a specific email domain (@looker.com) to a trust level or group. mcwumbly and sam confirmed that this feature is not built-in but could be implemented through a plugin.

codinghorror announced that the feature has been added, courtesy of zogstrip, allowing administrators to edit it from Admin, Groups, Custom. The feature adds users to a group based on their email domain upon signup or when the box is checked, but does not remove users from the group if their email domain does not match, as confirmed by riking and zogstrip.

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 Mi Piace

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 Mi Piace

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

9 Mi Piace

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 Mi Piace

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