Hide Login in Confluence Dashboard

Tet Cheng Chia August 12, 2015

Hi,

How do I hide just the login (at the top right hand corner) in Confluence Dashboard from anonymous users?

Thank you.

6 answers

1 accepted

1 vote
Answer accepted
Guilherme V.
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 12, 2015

Hey Tet, I found the following Custom HTML from another Atlassian Answer that another person created:

 

This script works for the "Demonstration Space" (which has a spaceKey of "ds") that ships wiith Confluence

Browse to Confluence Admin | Look and Feel | Custom HTML

In At the end of the HEAD, paste:

<script>
  AJS.toInit(function($){
    if (AJS.params.spaceKey == 'ds') {
      $('#login-link,#browse-menu-link').parent().hide(); // Hide the login & browse menu
    }
  });
</script>

Then Save.

Change the 'ds' bit to whatever the spaceKey is for your space.

 

2 votes
Stephen Deutsch
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.
August 13, 2015

This should work:

<script>
  AJS.toInit(function() {
    if (AJS.params.remoteUser == '') {
      AJS.$('#login-link').hide();
    }
  });
</script>
Chris Purser June 8, 2016

This is the one that worked for me

Joerg Marzoner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 6, 2020

This one worked for me as well

Thanks!

0 votes
Chris Purser June 8, 2016

This worked for me as well! 

Thanks! Perfect solve.

0 votes
Tet Cheng Chia August 13, 2015

Thank you!  It works!

0 votes
Tet Cheng Chia August 12, 2015

Hi Stephen,

 

I tried your method but it does not work.  Actually I also tried this script which is working but it hides the whole menu bar from anonymous users:

<script>

  AJS.toInit(function() {

  if (AJS.params.remoteuser == '') {

  AJS.$('header').hide();

}

});

</script>

 

How do I modify this script to just hide the login button in the menu bar.  I would like to leave the rest (eg. quick search textbox) visible.

Thank you

0 votes
Stephen Deutsch
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.
August 12, 2015

The script that Guilherme linked to will block the login link for a particular space, but not from the dashboard.

This would probably work better:

&lt;script&gt;
  AJS.toInit(function($){
    if (document.location.href.indexOf("dashboard.action") !== -1) {
      $("#login-link").parent().hide(); // Hide the login menu
    }
  });
&lt;/script&gt;

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events