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

getGroupsForUser returns incorrect results for role names containing periods #236

Closed mfen closed 5 years ago

mfen commented 7 years ago

Role name arguments supplied to getGroupsForUser have periods replaced by underscores, when period replacing appears to be intended for group names only.

In such cases, getGroupsForUser returns the groups for a different, similarly named role actually containing underscores instead of periods, or, if such a role does not exist, an empty array.

Roles.createRole('users.view');
Roles.addUsersToRoles(user._id, 'users.view', group);
Roles.getGroupsForUser(user._id, 'users.view'); // Returns []
neoromantic commented 7 years ago

Second that, just stumbled on this.

payner35 commented 7 years ago

+1