# Automatically map email domains to groups / permission sets?

**URL:** https://meta.discourse.org/t/automatically-map-email-domains-to-groups-permission-sets/23624
**Category:** Feature
**Created:** [1월 3, 2015, 2:28오전 UTC](https://meta.discourse.org/t/automatically-map-email-domains-to-groups-permission-sets/23624 "2015-01-03T02:28:54Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![joshsiegel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshsiegel/32/128958_2.png) [@joshsiegel](https://meta.discourse.org/u/joshsiegel)
#### Post date: [1월 3, 2015, 2:28오전 UTC](https://meta.discourse.org/t/automatically-map-email-domains-to-groups-permission-sets/23624/1 "2015-01-03T02:28:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [1월 3, 2015, 2:45오전 UTC](https://meta.discourse.org/t/automatically-map-email-domains-to-groups-permission-sets/23624/2 "2015-01-03T02:45:55Z")

</div>

This was a nice feature of Zendesk.

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [1월 3, 2015, 10:50오전 UTC](https://meta.discourse.org/t/automatically-map-email-domains-to-groups-permission-sets/23624/3 "2015-01-03T10:50:55Z")

</div>

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

---

<div class="post-metadata">

### Author: ![kpfleming](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kpfleming/32/116414_2.png) [@kpfleming](https://meta.discourse.org/u/kpfleming)
#### Post date: [1월 5, 2015, 8:29오후 UTC](https://meta.discourse.org/t/automatically-map-email-domains-to-groups-permission-sets/23624/4 "2015-01-05T20:29:48Z")

</div>

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 26, 2015, 10:46오후 UTC](https://meta.discourse.org/t/automatically-map-email-domains-to-groups-permission-sets/23624/5 "2015-01-26T22:46:02Z")

</div>

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

 ![](https://global.discourse-cdn.com/meta/original/3X/7/6/76b638324b7b00d15ad4a6b966d9fa3b822ce3ec.png)

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [1월 27, 2015, 1:33오전 UTC](https://meta.discourse.org/t/automatically-map-email-domains-to-groups-permission-sets/23624/6 "2015-01-27T01:33:53Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [1월 27, 2015, 1:37오전 UTC](https://meta.discourse.org/t/automatically-map-email-domains-to-groups-permission-sets/23624/7 "2015-01-27T01:37:56Z")

</div>

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

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [1월 27, 2015, 9:39오전 UTC](https://meta.discourse.org/t/automatically-map-email-domains-to-groups-permission-sets/23624/8 "2015-01-27T09:39:31Z")

</div>

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 29, 2015, 10:50오후 UTC](https://meta.discourse.org/t/automatically-map-email-domains-to-groups-permission-sets/23624/9 "2015-01-29T22:50:23Z")

</div>

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