# Hide Specific Part of a Menu Based on Logged in User Status/Role

> We recommend creating more than one menu per layout to specify users' views based on their role/status. However, if you’re looking for a bit of code to…

Source: https://tadabase.com/docs/snippets/hide-specific-part-of-a-menu-based-on-logged-in-user-statusrole  
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 Specific Part of a Menu Based on Logged in User Status/Role”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1664943227841.png)

We recommend creating more than one menu per layout to specify users' views based on their role/status. However, if you’re looking for a bit of code to hide an item if the user is not logged in, you can use the following code.

**Step 1**

**Copy your specific selector as seen in the image below.**

![Screenshot for “Hide Specific Part of a Menu Based on Logged in User Status/Role”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/8a0a98441251cf9b68c717c28533edab43d01e9c.png)

**Step 2**

**Copy and paste the following code into the JavaScript tab of the page and remember to change ‘PASTE_SELECTOR_HERE’ with the selector you copied above.**

```
var selector = 'PASTE_SELECTOR_HERE';
$(function() {
    var loggedInUser = '{loggedInUser.Name}';
    if (!loggedInUser) {
        console.log('Not Logged In');
        $(selector).css('display', 'none');
    }
});
```

![Screenshot for “Hide Specific Part of a Menu Based on Logged in User Status/Role”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1664944226988.png)

**Original Community Post:**

[Hide a title - Code CSS - Community Discussions / How Do I - Tadabase Community](https://community.tadabase.io/t/hide-a-title-code-css/1626/10)
