# \[Widget\] Menu baseado em permissão de grupo

**URL:** <https://meta.discourse.org/t/widget-menu-based-on-group-permission/91997>\
**Category:** Development\
**Created:** [Julho 10, 2018, 4:15pm UTC](https://meta.discourse.org/t/widget-menu-based-on-group-permission/91997 "2018-07-10T16:15:20Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tanzaho](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tanzaho/32/119781_2.png) [@tanzaho](https://meta.discourse.org/u/tanzaho)\
**Post date:** [Julho 10, 2018, 4:15pm UTC](https://meta.discourse.org/t/widget-menu-based-on-group-permission/91997/1 "2018-07-10T16:15:21Z")

</div>

I have a navigation menu built with the `api.decorateWidget` method.

Here is an example from my template, file:

```
<script type="text/discourse-plugin" version="0.2">
api.decorateWidget('home-logo:after', helper => {
    const showExtraInfo = helper.attrs.minimized;
        if(!showExtraInfo) {
            return helper.h('ul.nav-link-container', [
                helper.h('li.hidden-for-mobile', [
                    helper.h('a.nav-link', {
                        href:'https://myforum.com/publicCategory',
                        text:'My Public Category',
                        target:'_self'
                    })
                ]),
                helper.h('li.hidden-for-mobile', [
                    helper.h('a.nav-link', {
                        href:'https://myforum.com/privateCategory',
                        text:'My Private Category',
                        target:'_self'
                    })
                ])
           ]);
        }
});
</script>

```

It works fine, and allows connected users to visit my public and private categories.

Now, I would like to hide the second link based on group permissions.  
It seems very complicated to me since I didn’t look into Discourse widgets documentation, and I fear that this behavior is not possible.

Can anyone tell me if I could change/hide the link based on the current user groups? If yes, in what direction should I start looking?

---

_[View the full topic](https://meta.discourse.org/t/widget-menu-based-on-group-permission/91997)._
