-
-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[V4.0.0] getRolesForUserAsync() is broken on server #406
Comments
Thank you for submitting this issue! We, the Members of Meteor Community Packages take every issue seriously. However, we contribute to these packages mostly in our free time. If you think this issue is trivial to solve, don't hesitate to submit Please also consider sponsoring the maintainers of the package. |
Hi @Twisterking thank you for reporting. Can you please also add to the code example how you created the roles and added the user to the roles so we can use it to reproduce? |
I debugged this further now by forking the package locally. If I run this simple code, I actually get a const res = await Meteor.roleAssignment.countDocuments({ 'user._id': 'seDueMBtGiuMCWez6' }); // returns undefined, should return a number
const myRandomRole = await Meteor.roleAssignment.findOneAsync({ 'user._id': 'seDueMBtGiuMCWez6' }); // returns one of my roles I can make it work very easily if I change the logic of your Either this is a bug in Meteor 3.0.2 or there is some kind of package in my codebase screwing up this functionality. |
I am really sorry everyone ... I found the issue. Not a bug, this was our mistake! |
No problem |
I don't understand what is going on ...
We just upgraded to Meteor 3.0.2 and meteor-roles version
4.0.0
.And somehow, I think, on server the async version of
getRolesForUserAsync()
is broken.In a very simple Meteor method, the following gives a totally wrong result:
This makes no sense. The same code on client in the sync version works perfectly fine and
isAdmin == true
.What am I doing wrong here? This is the very basics of this package ... what is going on here?
I hope someone can help!
best, Patrick
The text was updated successfully, but these errors were encountered: