# Group Assignment SQL Query

**URL:** <https://meta.discourse.org/t/group-assignment-sql-query/25610>\
**Category:** Feature\
**Created:** [February 24, 2015, 2:35pm UTC](https://meta.discourse.org/t/group-assignment-sql-query/25610 "2015-02-24T14:35:58Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![thomaspurchas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomaspurchas/32/115664_2.png) [@thomaspurchas](https://meta.discourse.org/u/thomaspurchas)\
**Post date:** [February 24, 2015, 2:35pm UTC](https://meta.discourse.org/t/group-assignment-sql-query/25610/1 "2015-02-24T14:35:58Z")

</div>

Before I get to my feature request, I would like to take the time to thank the Discourse team for their work. Discourse is an epic piece of software, and so far everyone I have introduced it to has nothing but high praise for it.

# Feature

Would it be possible to extend the Badge Query options to groups.

Currently groups can either be assigned by email domain or manually. Adding SQL queries would extend that to support anything an admin can imagine.

## Use Case

I currently use SSO to integrate discourse into the rest of our society’s site. Our society’s site manages a number of things such as rotas, POS and film schedules.

To do this our site used groups to assign rights to various members. I would like to extend these groups over to discourse.

Currently I am using the `custom_fields` provided by SSO and SQL queries to assign badges to people based on their roles. Adding SQL queries to groups would also allow me to assign groups based on their roles.

This then allows me to create private categories so that teams can discuss topics that are only pertinent to that team.

---

_[View the full topic](https://meta.discourse.org/t/group-assignment-sql-query/25610)._
