Show/hide folder pages menu

Hello! Are there a way to hide in menu the folder with various pages at least that you have a role for this?. My idea is that folder contain various pages, and each page only have access only one role. So at least that you have one of this roles, you cant see this folder menu and pages

You can make your own menu with buttons and use this code :

import wixUsers from 'wix-users';
$w.onReady(function(){
    const currentUser = wixUsers.currentUser;
    if (currentUser.loggedIn && currentUser.role === 'Admin'){
        //Show components:
        $w('#button1').show();
    };
});

I tried to do this but this function if you are log out and log in, it doesnt appear, you have to refresh another time the page