Meteor-Community-Packages / meteor-roles

Authorization package for Meteor, compatible with built-in accounts packages
http://meteor-community-packages.github.io/meteor-roles/
MIT License
921 stars 168 forks source link

Expose query object from getUsersInRole #100

Closed czeslaaw closed 8 years ago

czeslaaw commented 9 years ago

Hi

I use your package a lot and it is great. I wonder if you could add possibility to get query object from getUsersInRole function, right before it calls Meteor.users.find.

Something like

_getUsersInRoleQuery(role, group) {
  // same logic as getUsersInRole but returns query object instead of calling Meteor.users.find
}

then getUsersInRole would be just

getUsersInRole(role, group) {
  return Meteor.users.find(_getUsersInRoleQuery(role, group));
}

It would be useful is scenarios:

I can do PR but i wonder if you think this is a good idea.

Thanks a lot :)

mitar commented 8 years ago

Done in v2.0 branch.