Making user search scoped to a group

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.

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

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.

1 Like

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?

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.