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
920 stars 164 forks source link

[V2] userIsInRole should check that id is a string #323

Closed Floriferous closed 4 years ago

Floriferous commented 4 years ago

The following code doesn't work as I would expect:

const userId = Meteor.users.insert({});
Roles.setUserRoles(userId, 'admin');

Roles.userIsInRole(() => {}, 'admin'); // Returns true

The line here should check that the id is a string.

This used to fail properly in Roles V1.

SimonSimCity commented 4 years ago

Is this only related to v2 or also to v3?

Floriferous commented 4 years ago

Not sure, haven’t looked at v3 code.

SimonSimCity commented 4 years ago

Fixed in #324.