Role-based Menu component items
const userHasAccess = {{user.role}} === 'admin'; // Replace with your actual access condition
const menuItems = [
{
title: 'Dashboard',
route: '/dashboard',
disabled: false // This item is always enabled
},
{
title: 'Admin Panel',
route: '/admin',
disabled: !userHasAccess // This item is disabled if the user is not an admin
}
// ... other menu items
];
return menuItems;
Last updated
Was this helpful?