meteor-roles icon indicating copy to clipboard operation
meteor-roles copied to clipboard

Document when `Roles.userIsInRole` is usable on the client

Open Prinzhorn opened this issue 4 years ago • 0 comments
trafficstars

The code reveals that I need to wait for Roles.subscription.ready(), additionally I wait for Accounts.loginServicesConfigured() so that my user is ready as well. Roles.subscription.ready() should be documented in the Client section, which currently only talks about Blaze and some general security advice.

I'm not using Blaze so I can't comment on the isInRole helper and if it's safe to use it immediately or if everyone just gets lucky because the rendering usually loses the race against the subscription I/O.

Prinzhorn avatar Aug 26 '21 09:08 Prinzhorn