# Handlebars template conditional for trust level

**URL:** https://meta.discourse.org/t/handlebars-template-conditional-for-trust-level/308708
**Category:** Development
**Created:** [May 20, 2024, 3:02pm UTC](https://meta.discourse.org/t/handlebars-template-conditional-for-trust-level/308708 "2024-05-20T15:02:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![prome17](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@prome17](https://meta.discourse.org/u/prome17)
#### Post date: [May 20, 2024, 3:02pm UTC](https://meta.discourse.org/t/handlebars-template-conditional-for-trust-level/308708/1 "2024-05-20T15:02:28Z")

</div>

Can we target trust levels within a theme component? I want to display an alert for users who have lower trust levels and don’t yet have specific permissions but for it to go away once they level up.

---

<div class="post-metadata">

### Author: ![HamMan2118](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hamman2118/32/383565_2.png) [@HamMan2118](https://meta.discourse.org/u/HamMan2118)
#### Post date: [May 20, 2024, 6:24pm UTC](https://meta.discourse.org/t/handlebars-template-conditional-for-trust-level/308708/2 "2024-05-20T18:24:39Z")

</div>

This would be a great idea to have as a theme (component).

On many forums I am active in there are restrictions (for example, TL1 is required to make topics) so it would be nice to have as a dismissible banner, alert, etc. built into the theme.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [May 20, 2024, 6:35pm UTC](https://meta.discourse.org/t/handlebars-template-conditional-for-trust-level/308708/3 "2024-05-20T18:35:00Z")

</div>

The [Welcome Link Banner](https://meta.discourse.org/t/welcome-link-banner/218743) has a setting to choose which trust levels will see the banner.

> <https://github.com/discourse/discourse-welcome-link-banner/blob/3ee5729fd9d8e4832c4058e9e263070ab54df6d5/javascripts/discourse/components/welcome-link-banner.js#L21>

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [May 20, 2024, 6:56pm UTC](https://meta.discourse.org/t/handlebars-template-conditional-for-trust-level/308708/4 "2024-05-20T18:56:50Z")

</div>

Moin showed a good example. Depending on where you try to access the user’s data, you might need to access it differently, though. Here, it’s a glimmer component, and a service is defined above (`@service currentUser`).

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [June 19, 2024, 6:56pm UTC](https://meta.discourse.org/t/handlebars-template-conditional-for-trust-level/308708/5 "2024-06-19T18:56:55Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
