Avatar

Level 4

Hi All,

I'm trying to get a context named userAdmin from within the handlebars framework for AEM Social Communities. The userAdmin context checks if the logged in user is a member or a moderator.

We already have this code within /libs/social/console/components/hbs/sitenavbar/sitenavbar.hbs at line number 54. With the below userAdmin context the Administration link appears only if the logged in user is a moderator/Community Admin

                {{#if userAdmin}}
                    <li><a href="{{adminUrl}}">{{i18n "Administration"}}</a></li>
                {{/if}}

Problem

I'm not able to fetch the same userAdmin context within /libs/social/messaging/components/hbs/messagebox/buttons.hbs at line number 36 where I want to the new message button only if the logged in user is a moderator/Community Admin

                {{#if userAdmin}} //Here the context is not available within the buttons.hbs
                    <input type='submit' class='actionbuttons' id='newMessageButton' name='{{properties.replyURL}}' value='{{i18n "+ New Message"}}' />
                {{/if}}

Could you please help me to figure out a way to get the context available in sitenavbar to any other SCF component like messagebox or forums. I've also tried using options like {{../userAdmin}} and {{@rootuserAdmin}}

 Any suggestion or help would be great.

Thanks, Bharath