Closed isAlmogK closed 9 years ago
Hi Almog, this should be logged under the accounts-entry repo. But if you can post a reproduction on github I can help you to debug.
On Wednesday, November 12, 2014, Almog Koren notifications@github.com wrote:
I'm testing out the roles package, when I create a new user via meteor passwords using the accounts entry package I'm not seeing the roles in the user db object I'm also not seeing the global roles db doc.
— Reply to this email directly or view it on GitHub https://github.com/alanning/meteor-roles/issues/67.
Adrian Lanning Co-Founder, CTO Share911 P: 203-895-8830 https://share911.com/
So it's a bit wired once I call
Roles.addUsersToRoles(user._id, roleToSet);
Then it's fine
So I this was not working if (user.roles.length > 0)
I had to do this if (_.isEmpty(user.roles)) { Roles.addUsersToRoles(user._id, roleToSet); }
user.roles
would not necessarily exist if the user didn't have any roles
so that length check was probably throwing an error in your logs.
On Wednesday, November 12, 2014, Almog Koren notifications@github.com wrote:
So it's a bit wired once I call
Roles.addUsersToRoles(user._id, roleToSet);
Then it's fine
So I this was not working if (user.roles.length > 0)
I had to do this if (_.isEmpty(user.roles)) { Roles.addUsersToRoles(user._id, roleToSet); }
— Reply to this email directly or view it on GitHub https://github.com/alanning/meteor-roles/issues/67#issuecomment-62819497 .
Yea that's what I thought, it might be good to update the docs I thought roles we're added even if the user had none I thought it was a black object.
I'm testing out the roles package, when I create a new user via meteor passwords using the accounts entry package I'm not seeing the roles in the user db object I'm also not seeing the global roles db doc.