Show component only to a specific group via script?

Hey :vulcan_salute:

I want to create a component (header) in a theme that will only be visible to a certain group of users.

I’m use this script:

<script type='text/x-handlebars' data-template-name='/connectors/above-main-container/test'>
  {{#if currentUser}}
     <h1>Hello, {{currentUser.username}}!</h1>

What should I replace this parameter {{#if currentUser}} with so that only users from group “HackOneGroup” can see the component?

I try this {{#if === "HackOneGroup"}} but it’s wot work.

Please help :pleading_face: :pray:

maybe this will interest you


I think it might be similar to this what you are looking for :thinking:


I found this {{#if currentUser.staff}} it’s work and show content only for the staff, but it’s didn’t work if I change staff to other, example: {{#if currentUser.trust_level_0}} :confused:

Would the CSS Classes for Current User's Groups theme component help?

1 Like