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

Add getUsersInRoleQuery to return only the query for getUsersInRole #179

Closed nabiltntn closed 8 years ago

nabiltntn commented 8 years ago

It's useful to have a separate function that returns the query generated inside getUsersInRole function and call it from the latter.

A simple use case for this new function is in aldeed:meteor-tabular package :

TabularTables.SpecificUsers = new Tabular.Table({
  collection: Meteor.users,
  selector: function( userId ) {
    return Roles.getUsersInRoleQuery('specific-role','a-group');
  }
});
mitar commented 8 years ago

This is already done in v2.0 branch: https://github.com/alanning/meteor-roles/blob/v2.0/roles/roles_common.js#L995

Also, please do not change style inside feature pull request. It is really hard to see what your pull request is changing. Look at all differences GitHub is showing in the diff.

nabiltntn commented 8 years ago

OK, it's almost the same implementation. For style, maybe i have some issue with my IDE. Closing the PR.