Closed romant closed 8 years ago
Looks like role
needs to be a String: http://alanning.github.io/meteor-roles/files/roles_roles_common.js.html#l485
The code iterates over user.roles but not role.
Yes, currently that function requires a single string. I think you may be confused by the jsdoc syntax; in this case brackets around the parameter name indicate that the parameter is optional. If the parameter accepts a String or an Array, the format would be:
* @param {Array|String} role Name of role/permission...
Thank you @alanning. That's helpful.
Don't suppose any plans underway to add array of strings support ? Or is focus on v.2 ? In which case - what's the plan for behaviour there for a multiple role check?
This is a duplicate of #140 for which there was a pull request #148.
In v2.0 this is already implemented.
See also tests in c07767d6e0c792e774a156788ee5fad52163c2d3 to see if that covers your use case.
Thank you @mitar. What's the eta for v2.0 ?
See #165 for the discussion on the topic. You can also try it out in v2.0 branch. I think most things are ready, but it needs more testing by users so that we see if everything works as expected.
documentation relates :
Yet trying it with a user that belongs to a group; upon which I then query
Roles.getGroupsForUser('mCE2dx2n964MbLjPi', ['oger','minion'])
results in an empty[]
Whilst the same query for a single role
Returns the expected array of Groups.
I notice that the code actually does iterate over all the
groupRoles
- but in this case - actually returns an empty array.Any pointers on debugging?
Many thanks.