//Import uStoreProvider if it is not already in your component:
import { UStoreProvider } from '@ustore/core'
//Get the current logged in user
const { currentUser } = UStoreProvider.state.get() || {}
//Get the user groups that the user is a member of
const userGroups = (currentUser && currentUser.Groups) || []
//Define the group(s) that should see the menu
const allowedGroups = ["Managers","VIPs"]
//then add your menu only if the user is in the menu
//code depends on how you are creating your menu item
//Bonus trick:
//Instead of hard-coding the names of the permitted groups into the theme, you could instead
//define a new variable and add the variable into the config.json so that the theme editor can
//be used to change the permitted groups instead of having to edit and publish a new theme.
const allowedGroups = getVariableValue('--cust-menu-usergroup', '')
.split(',')
.map(name => name.trim().toLowerCase())
.filter(name => name.length > 0)