Hide/Show member pages based on User role

Hi,
first of all role titles are string so you need to do if(roles.includes( 130 ))
Second, I never work with Wix Menus since I always want to have full customization option, so I careate my own menu, so I can say what I thik you should do but I never really tried it.
You can try:

let allPages = [];
$w.onReady(() => {
allPagesMenu = $w('#menu').menuItems;
if(authentication.loggedIn()){getRoles();}
authentication.onLogin(getRoles);
})
///...code ...code
.then(roles => { roles = roles.map(e => e.title);
  if(roles.includes('130')){
$w('#menu').menuItems = allPagesMenu.filter(e => e.label !== '150');
} else if(roles.includes('150')){
$w('#menu').menuItems = allPagesMenu.filter(e => e.label !== '130');
}
///..code

Sorry for the late reply.
P.S
In the The allPagesMenu.filter(e => e.label !== ‘150’); the ‘150’ stand for the page name.


TO THE FORUM MODARTED: I accidently reported my own reply as spam when I tried to edited it. Please ignore.