Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Hiding "Tools" menu for anonymous users

Bruce Garlock April 4, 2013

We are using an older version of Confluence - 3.4.3, and I am using the "Intranet Theme". For anonymous users, we would like to hide the Tools menu. What is the simpilest way to accomplish this?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Amalia
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2013

You can add JS to Confluence Admin > Custom HTML > At the end of the HEAD

AJS.toInit(function(){
    if (AJS.params.remoteUser == ''){
        AJS.$('#action-menu-link').hide();
    }
});


https://confluence.atlassian.com/display/CONFKB/How+to+Use+JavaScript+in+Confluence

https://confluence.atlassian.com/display/CONFKB/How+to+Hide+Elements+in+Confluence+Using+CSS+or+JavaScript

Bruce Garlock April 4, 2013

Thank you so much for the links, and the JS code. I added the following to the end of the HEAD section, and it still shows the "Tools" menu to anonymous users:

<script type="text/javascript">
    AJS.toInit(function(){
        if (AJS.params.remoteUser == ''){
          AJS.$('#browse-menu-link').hide();
        }
    });
</script>

This is Confluence 3.4.3 - is it too old to work with this JS?

Is there another way to do this?

Many thanks,

Bruce

Bruce Garlock April 4, 2013

Hi - I think I figured it out - 3.4.3 must not be passing the loggedIn user, because when I went to the console, and issued a

AJS.params

none of the vars had the logged in user. No big deal, because for this space, it's mostly view only by anonymous users, so I am just grabbing the 'spaceKey=XXX' and removing the menus that way.

Thanks again so much for heading me in the right direction! Very valuble information!

Many thanks,

Bruce

Amalia
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2013

great finding :) glad that it works now

TAGS
AUG Leaders

Atlassian Community Events