How to hide the Space Directory button for Anonymous users

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

Please note that all the workaround stated on this page are beyond Atlassian Support Offerings.

目的

The Space Directory provides a list of all the spaces in your Confluence site. If you need to disable the Space Directory for anonymous users, you may do so by using JavaScript as per highlighted below.

ソリューション

  1. Navigate to Confluence Administration page >> Custom HTML.
  2. 編集をクリックします。
  3. Add the following to At the end of the HEAD section and click Save:

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

You may also want to hide the Spaces list that is presented on the sidebar. If that is the case, just use the following script instead:

<script>
  AJS.toInit(function(){
    if (AJS.params.remoteUser == ''){
      AJS.$('#space-menu-link').hide();
      AJS.$('#sidebar-spaces').hide();
    }
  });
</script>

Related guide:

最終更新日 2021 年 4 月 9 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.