I want to manage the users of my Meteor application, and for this I will need to find out their current roles. I have a page setup available only to admin users, and this page is subscribed to a collection of users.
In my template for this page, I have the following:
{{#each user}} <p> <a href="/@{{username}}">{{username}}</a> {{#if isInRole 'admin'}} Admin{{/if}} </p> {{/each}}
Unfortunately, this leaves me with a problem when the user role in the log (which is the administrator) is mapped in the {{#if isInRole 'admin'}} block. This leads to the fact that all users have administrator status (which is not the case).
How to check if a user who is displayed in each block is in a specific role?
Edit Note: I am using the alanning / meteor-role package
The database has a list of all users, and I want to see their administrator status.
source share