# Admin Nav Tenancy

**URL:** <https://forums.losant.com/t/admin-nav-tenancy/5557>\
**Category:** Help\
**Tags:** users, cpf\
**Created:** [August 8, 2024, 1:52pm UTC](https://forums.losant.com/t/admin-nav-tenancy/5557 "2024-08-08T13:52:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanner\_Williams](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tanner\_Williams](https://forums.losant.com/u/Tanner_Williams)\
**Post date:** [August 8, 2024, 1:52pm UTC](https://forums.losant.com/t/admin-nav-tenancy/5557/1 "2024-08-08T13:52:10Z")

</div>

We would like to have technicians at the system level, but not let them be able to see/access these admin settings  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/d/d6fc2ea6c89837ac60aa5ee2fe5461c41d55ce14.png)  
we tried setting their cpf role to editor and changing all the tabs visibility to editor but it doesn’t seem to be working

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/d/d5effcac8d8821af33cffbb065eca604e6204902.png)  
It would also work if we just did a custom tag on certain accounts to make them be able to access this section as our technicians wont have access to our losant back end. Im just unsure where the check to display this section even takes place in all of the layouts or pages

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [August 8, 2024, 4:39pm UTC](https://forums.losant.com/t/admin-nav-tenancy/5557/2 "2024-08-08T16:39:33Z")

</div>

This can be done by adding a tag to your technicians and making a slight modification to the code that controls the nav item visibility.

1. Make a new user and add them to the `System` group.
2. Set their `cpf_role` tag to `admin`.
3. Add a `technician` tag and set it to `true`.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/0/06cbe228f6f26a20c443b0c16ff6bbfd64c0af72.png)

1. Open the workflow `cpf-element-nav` and click on the Function Node.
2. Scroll to the bottom of the code and add the following two lines. The code must be placed directly above the last two lines.

```javascript
payload.pageData.navItemsTop = itemsFlattened.filter((i) => { return i.nav_location !== 'bottom' });
payload.pageData.navItemsBottom = itemsFlattened.filter((i) => { return i.nav_location === 'bottom' });

// NEW CODE START
// Removes all bottom nav items if the user is tagged as a technician.
if(payload.experience.user.userTags.technician === 'true') {
    payload.pageData.navItemsBottom = [];
}
// NEW CODE END

payload.pageData.navItemsTop = JSON.stringify(payload.pageData.navItemsTop);
payload.pageData.navItemsBottom = JSON.stringify(payload.pageData.navItemsBottom);

```

This fix only hides the nav items. These users can still navigate directly to the admin pages by typing the URL in the address bar. The admin pages are only checking that the user is a member of the `system` group, which these technicians are. This might be OK for your use case. If not, you’ll need to modify each of the `cpf-page-admin-xyz` workflows to also check that the user is not a technician. This can be done by modifying the Conditional Node near the top of each workflow:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/f/f0be99fa6e420fc169cfe69cd007c8b7c5be4731.png)

The new expression is:

```auto
{{pageData.userLevel}} == 0 && {{experience.user.userTags.technician}} !== 'true'

```

All admin page workflows have two triggers (one for GET and one for POST). You’ll need to update the Conditional Node under both.

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [August 8, 2024, 4:47pm UTC](https://forums.losant.com/t/admin-nav-tenancy/5557/3 "2024-08-08T16:47:49Z")

</div>

> [@Tanner\_Williams](#):
>
> we tried setting their cpf role to editor and changing all the tabs visibility to editor but it doesn’t seem to be working

This didn’t work because the user was in the system group. Currently, it’s just assumed system admins can access everything, so there’s a lot of places that skip further checks for system admins.

---

<div class="post-metadata">

**Author:** ![Tanner\_Williams](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tanner\_Williams](https://forums.losant.com/u/Tanner_Williams)\
**Post date:** [August 8, 2024, 5:16pm UTC](https://forums.losant.com/t/admin-nav-tenancy/5557/4 "2024-08-08T17:16:06Z")

</div>

perfect this is exactly what i was looking for and also yep that’s what i was thinking after messing with the system level roles. Thank you!
