Meteor/Roles in Meteor 3 app, template helper "isInRole" not working

I have a template app I’m using to learn more about Meteor 3. In this app I have a header nav bar template. In that template I use the Meteor/Roles project to determine if the current user is allowed to see some nav items. for this I use the template helper in my “headerbar.html” file as is defined in the documentation:

{{#if isInRole 'systemadmin'}}
    <li><a href="#">Manage App</a></li>
{{/if}}

in the “headerbar.js” file I have imported the meteor/roles as well with

import { Roles } from 'meteor/roles';

I have verified that the role for systemadmin does indeed exist, and have ensured the user is assigned that role in the role-assignment collection.

Regardless, the template helper never shows the “Manage App” option int he nav when it’s inside this helper. If I pull that <li> out of the helper it displays as expected.

Any help on this would be much appreciated.

1 Like

hey! I’ll check on this and let you know how it goes!

I appreciate your willingness to help out. If you find anything that might be causing the issue with the isInRole helper, please share your findings. I’m eager to get this working so I can continue learning.

Yes, please let me know if it works for you. I can write a method to check it from the JS side, ubt it just seems redundant.