# Creating a gender limited forum?

**URL:** https://meta.discourse.org/t/creating-a-gender-limited-forum/76192
**Category:** Support
**Created:** [December 16, 2017, 2:57am UTC](https://meta.discourse.org/t/creating-a-gender-limited-forum/76192 "2017-12-16T02:57:11Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ericskiff](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ericskiff/32/79557_2.png) [@ericskiff](https://meta.discourse.org/u/ericskiff)
#### Post date: [December 16, 2017, 2:57am UTC](https://meta.discourse.org/t/creating-a-gender-limited-forum/76192/1 "2017-12-16T02:57:11Z")

</div>

I’m working with a entrepreneur to create a women’s only discourse forum. I’ve explored custom fields and have a gender option present during signup, but the ideal for this particular forum would be to only allow facebook signups and to pull gender from there.

I’m a rails developer so this seems accomplishable in abstract, but I’m not sure if the discourse plugin system has hooks into the Facebook login flow. Would something like this be possible? Where’s the best place to start learning about what plugins can and cant do?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [December 16, 2017, 5:54am UTC](https://meta.discourse.org/t/creating-a-gender-limited-forum/76192/2 "2017-12-16T05:54:31Z")

</div>

You can find resources related to the plugin development here in [Search results for '#howto plugin development' - Discourse Meta](https://meta.discourse.org/search?q=%23howto%20plugin%20development)

> [@ericskiff](#):
>
> what plugins can and cant do?

In Discourse a plugin can do almost anything ✨

Since you are only allowing signups from Facebook it is easier to implement this feature. We already saving gender value in `facebook_user_infos` table. Similar code like below can work for you _(not yet tested)_

```ruby
after_initialize do

  FacebookUserInfo.class_eval do

    after_commit : add_to_gender_group, on: :create

    def add_to_gender_group
      return if gender.blank?

      group = Group.find_by name: gender.downcase
      group.add user
    end

  end

end

```

And you can limit all your categories only for “female” group.

---

<div class="post-metadata">

### Author: ![ericskiff](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ericskiff/32/79557_2.png) [@ericskiff](https://meta.discourse.org/u/ericskiff)
#### Post date: [December 16, 2017, 12:16pm UTC](https://meta.discourse.org/t/creating-a-gender-limited-forum/76192/3 "2017-12-16T12:16:11Z")

</div>

Oh my gosh. This is beyond amazing. Years working on wordpress, and hundreds of integrations with APIs in rails, and I’ve never gotten “here’s what you need on a platter” assistance like this. You’re the best!

If I develop this plugin, can I use it on the official hosted discourse, or will I need to host my own?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 16, 2017, 1:19pm UTC](https://meta.discourse.org/t/creating-a-gender-limited-forum/76192/4 "2017-12-16T13:19:21Z")

</div>

Custom plugins require enterprise hosting. If you’d like help with self hosting, that’s what I do: [Redirecting…](https://www.literatecomputing.com/product/discourse-install/)

---

<div class="post-metadata">

### Author: ![8BIT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/8bit/32/76872_2.png) [@8BIT](https://meta.discourse.org/u/8BIT)
#### Post date: [December 16, 2017, 3:47pm UTC](https://meta.discourse.org/t/creating-a-gender-limited-forum/76192/5 "2017-12-16T15:47:27Z")

</div>

@pfaffman is one of the best.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [February 19, 2020, 12:54am UTC](https://meta.discourse.org/t/creating-a-gender-limited-forum/76192/6 "2020-02-19T00:54:11Z")

</div>



---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [February 19, 2020, 1:13am UTC](https://meta.discourse.org/t/creating-a-gender-limited-forum/76192/7 "2020-02-19T01:13:02Z")

</div>


