How to hide the Space Tools menu for certain users or groups in Confluence

お困りですか?

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

コミュニティに質問


プラットフォームについて: 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 は除く

This guide is for informational purposes and is not eligible for support from Atlassian.  If you have any questions about the information on this page, please reach out to our Atlassian Community for help. 

目的

The Space Tools menu allows Space Administrator to manage their Spaces. If you need to disable the Space Tools menu for certain users you may do so by using JavaScript.

How to hide Space Tools menu for Anonymous users

  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-tools-menu-trigger").hide();
        }
      });
    </script>

How to hide Space Tools menu for users that are not members of confluence-admin group

Site-wide changes
  1. Navigate to Confluence Administration page >> Layout.
  2. Under the Site Layouts, search for Main Layout and click Edit/Create Custom.
  3. Find the following section: <head> and </head> tags.
  4. Copy and paste the following code before the </head> tag.

    #if ($userAccessor.hasMembership('confluence-administrators', $helper.action.remoteUser.name))
    #else
        <script type="text/javascript">
        AJS.toInit(function(){
    AJS.$('#space-tools-menu-trigger').hide();
        });
    </script>
    #end
Space-wide changes
  1. Navigate to the specific Space you want to apply this changes to.
  2. Go to Space Tools >> Look and Feel panel and click Layout.
  3. Under the Site Layouts, search for Main Layout and click Edit/Create Custom.
  4. Find the following section: <head> and </head> tags.
  5. Copy and paste the following code before the </head> tag.

    #if ($userAccessor.hasMembership('confluence-administrators', $helper.action.remoteUser.name))
    #else
        <script type="text/javascript">
        AJS.toInit(function(){
    AJS.$('#space-tools-menu-trigger').hide();
        });
    </script>
    #end
  6. Save the changes.








最終更新日 2022 年 4 月 13 日

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

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