Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add selector to Roles.getUsersInRole #376

Open
bratelefant opened this issue Aug 2, 2023 · 2 comments
Open

Add selector to Roles.getUsersInRole #376

bratelefant opened this issue Aug 2, 2023 · 2 comments

Comments

@bratelefant
Copy link
Contributor

I'm trying to get all users with a certain role (eg. "admin") that belong to a certain subset of the Meteor.users collection (eg. those users that have a certain tenancy id, say _tenancyId).

There's already the possibility to add queryOptions to the Roles.getUsersInRole cursor, for sorting or limiting results etc. Would be great if there was a way to add a querySelector that restricts the results from the Meteor.users collection.

I already tried some workarounds:

  • using Roles.getUsersInRole on the server, which then publishes all users, regardless of which _tenancyId they have. Not an option due to data security.
  • using custom publications, with observer callbacks on the Meteor.users collection
@github-actions
Copy link

github-actions bot commented Aug 2, 2023

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously.
Our goal is to provide long-term lifecycles for packages and keep up
with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time.
Therefore, we can't guarantee your issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit
a pull request, too! We will accompany you in the process with reviews and hints
on how to get development set up.

Please also consider sponsoring the maintainers of the package.
If you don't know who is currently maintaining this package, just leave a comment
and we'll let you know

@lucfranken
Copy link

Isn't this something where scopes would be the suggested solution by the package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants