# Ícones personalizados de admin/usuário no cabeçalho

**URL:** <https://meta.discourse.org/t/custom-admin-user-icons-in-header/108337>\
**Category:** Product Support\
**Created:** [4 Fevereiro , 2019 19:08 UTC](https://meta.discourse.org/t/custom-admin-user-icons-in-header/108337 "2019-02-04T19:08:07Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![WorldIsMine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/worldismine/32/455660_2.png) [@WorldIsMine](https://meta.discourse.org/u/WorldIsMine)\
**Post date:** [6 Fevereiro , 2019 07:57 UTC](https://meta.discourse.org/t/custom-admin-user-icons-in-header/108337/5 "2019-02-06T07:57:13Z")

</div>

Had small problems with that code @pmusaraj, also another dev team told me that this would be impossible to do with 2.2 as admin class isn’t used in 2.2? Not sure what that means. Anyway, our UI guy was able to do it (@shaundefense) via this code:

```
<script type="text/discourse-plugin" version="0.8.23">
const { iconNode } = require("discourse-common/lib/icon-library");
let currentUser = api.getCurrentUser();
let icon = 'shopping-cart';
if (currentUser && !currentUser.admin) {
  icon = 'shopping-cart';
}
if (currentUser && currentUser.admin) {
api.decorateWidget('header-icons:before', helper => {
    return helper.h('li', [
        helper.h('a#tickets-button', {
            href:'https://LinkOne.com',
            title: 'Link One',
            text: ''
        }, iconNode(icon)),
    ]);
});
}
</script>
<script type="text/discourse-plugin" version="0.4">
const { iconNode } = require("discourse-common/lib/icon-library");
let currentUser = api.getCurrentUser();
let icon = 'shopping-cart';
if (currentUser && !currentUser.admin) {
api.decorateWidget('header-icons:before', helper => {
    return helper.h('li', [
        helper.h('a#tickets-button', {
            href:'https://LinkTwo.com',
            title: 'Link Two'
        }, iconNode(icon)),
    ]);
});
}
</script>  

```

Now the button shows up, and it’s two function (for admin it’s different and for users, it displays another link). Thanks everyone for help.

---

_[View the full topic](https://meta.discourse.org/t/custom-admin-user-icons-in-header/108337)._
