# Making user search scoped to a group

**URL:** https://meta.discourse.org/t/making-user-search-scoped-to-a-group/34058
**Category:** Feature
**Created:** [10월 2, 2015, 4:50오후 UTC](https://meta.discourse.org/t/making-user-search-scoped-to-a-group/34058 "2015-10-02T16:50:43Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jvillasante](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jvillasante/32/116828_2.png) [@jvillasante](https://meta.discourse.org/u/jvillasante)
#### Post date: [10월 2, 2015, 4:50오후 UTC](https://meta.discourse.org/t/making-user-search-scoped-to-a-group/34058/1 "2015-10-02T16:50:43Z")

</div>

I’m trying to find a way that user mentions be scoped to only the group that the user mentioning is. I mean, I would like that when some user try to mention another, the choices she get for those others are scoped to his own group.

I thinking about patching app/models/user\_search.rb but since I’m new to rails i’m wondering how can I scope the user search to the group of the current user.

Any help will be much appreciated.  
Thanks!

---

<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: [10월 2, 2015, 7:20오후 UTC](https://meta.discourse.org/t/making-user-search-scoped-to-a-group/34058/2 "2015-10-02T19:20:00Z")

</div>

What does the “group of the current user” mean? What group are you in right now?

---

<div class="post-metadata">

### Author: ![jvillasante](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jvillasante/32/116828_2.png) [@jvillasante](https://meta.discourse.org/u/jvillasante)
#### Post date: [10월 3, 2015, 2:20오전 UTC](https://meta.discourse.org/t/making-user-search-scoped-to-a-group/34058/3 "2015-10-03T02:20:17Z")

</div>

I’m sorry, i didn’t explain my self, and forget my english by the way. What i want to do is that, when a given user wants to mention another she can only see those users that are on the groups wich have access to the category the user is posting into. I think that, for now, i would be happy to limit the users search to only those that are on any group that the current user is, but the need is to scope the search to all the users which belong to all the groups that has access to the category the current user is posting into.

I think this would be really hard to come by, any help will be much appreciated.

---

<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: [10월 3, 2015, 2:22오전 UTC](https://meta.discourse.org/t/making-user-search-scoped-to-a-group/34058/4 "2015-10-03T02:22:23Z")

</div>

OK, yeah. This has been discussed before, but consider this: what do you do when you want to have a discussion about a “problem user” in the staff category? Will their name just not autocomplete?

---

<div class="post-metadata">

### Author: ![jvillasante](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jvillasante/32/116828_2.png) [@jvillasante](https://meta.discourse.org/u/jvillasante)
#### Post date: [10월 3, 2015, 2:27오전 UTC](https://meta.discourse.org/t/making-user-search-scoped-to-a-group/34058/5 "2015-10-03T02:27:30Z")

</div>

I think the only way to do this is to find a way to whitelist some categories and do what i want on only certain categories. I know this is gonna be really hard to come around, just want a tip on where to start.

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [12월 4, 2025, 11:37오전 UTC](https://meta.discourse.org/t/making-user-search-scoped-to-a-group/34058/6 "2025-12-04T11:37:02Z")

</div>


