# Hide Menu Links Based on Roles, Status or Logged in Users

> This can natively have achieved by adding multiple rows in a layout and then protecting each of those rows based on the user role. Then I add a menu to…

Source: https://tadabase.com/docs/snippets/hide-menu-links-based-on-roles-status-or-logged-in-users  
Status: Not yet re-checked. Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

![Screenshot for “Hide Menu Links Based on Roles, Status or Logged in Users”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/2aec42a6a33d8e126c78d2171d7b987daa593a4e.jpeg)

This can natively have achieved by adding multiple rows in a layout and then protecting each of those rows based on the user role. Then I add a menu to each row and customize it based on what I want that user role to see, see photo.

**After assigning permission, we can get this working for the front end with the following steps.**

**Add the following code to the Login page's JavaScript tab.**

```
$(function() {
    (function() {
        if (window.localStorage) {
            localStorage['cameFromLoginPage'] = true;
        }
    })();
});
```

![Screenshot for “Hide Menu Links Based on Roles, Status or Logged in Users”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665155594042.png)

**Add the following code to the JavaScript tab of the destination page.**

```
$(function() {
    (function() {
        if (window.localStorage) {
            if (!localStorage.getItem('firstLoad') && localStorage['cameFromLoginPage']) {
                localStorage['firstLoad'] = true;
                localStorage.removeItem('cameFromLoginPage');
                window.location.reload();
            } else {
                localStorage.removeItem('firstLoad');
            }
        }
    })();
});
```

![Screenshot for “Hide Menu Links Based on Roles, Status or Logged in Users”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665155827681.png)

**Original Community Post:**

[Hide menu links based on Roles, Status, or Logout/Login Users - Community Discussions / How Do I - Tadabase Community](https://community.tadabase.io/t/hide-menu-links-based-in-roles-status-or-logout-login-users/102)
