nicolaslopezj / roles

The most advanced roles package for meteor
MIT License
87 stars 13 forks source link

How i can get all roles from user list? #17

Closed armandomendivil closed 8 years ago

armandomendivil commented 8 years ago

If i have a list of users, how i can get all roles from users as Meteor.user().roles()

example: users[0].roles() ["employer"] users[1].roles() []

nicolaslopezj commented 8 years ago

Check the pluck and union methods of underscore.

_.union.apply(this, _.pluck(users, 'roles'));