Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to disable attachment downloading, exporting, printing and other functions in some spaces

Recently, some teams using Confluence have put forward more advanced requirements for information confidentiality.

These space administrators want to prohibit users from downloading, exporting, and printing attachments in designated spaces.

Last week, I checked a lot of related setting posts in the community. According to the community’s suggestions, I adjusted the space configuration for your reference.

Hide the download button on the preview page

Space Tools--Look and feel--Layout--Content Layouts---Page Layout

<style type="text/css">
     
.cp-control-panel-download {
        
display:none !important;
    
}
 
      .cp-waiting-message-download {
        
display:none !important;
    }
      a.download-all-link {
        
display: none !important;
     
}
      a#download-all-link {
        display: none !important;
     
}
 
</style>

 

Hide attachment button

Space Tools--Look and feel--Layout--Content Layouts---Main Layout

#if ($userAccessor.hasMembership('confluence-administrators', $helper.action.remoteUser.name))
#else
    
<script type="text/javascript">
    
AJS.toInit(function(){
        
AJS.$('#view-attachments-link').hide();
        
AJS.$('#view-in-hierarchy-link').hide();
        
AJS.$('#content-metadata-attachments').hide();
    
});
</
script>
#end

#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

 

disable right mouse click

Space Tools--Look and feel--Layout--Content Layouts---Page Layout

<script type="application/javascript">
 content_dom = document.getElementsByClassName("confluence-embedded-file");
 
for (var i = 0; i < content_dom.length; i++) {
content_dom[i]
.oncontextmenu function () {
return false;
 
}
}
a_dom
 document.querySelectorAll('a[data-linked-resource-type="attachment"]')
for (var i 0; i < a_dom.length; i++) {
a_dom[i]
.oncontextmenu function () {
return false;
 
}
}
</script>

 

print out a blank page

Space Tools--Look and feel--Layout--Content Layouts---Page Layout

 <style type="text/css" media="print">
body { visibility: hidden; display: none }
</style>

 

Tips

https://confluence.atlassian.com/confkb/how-to-hide-the-space-tools-menu-for-anonymous-users-in-confluence-816877024.html

https://confluence.atlassian.com/confkb/how-to-hide-elements-in-confluence-using-css-or-javascript-313458894.html

https://confluence.atlassian.com/confkb/how-to-disable-attachment-downloads-215484007.html

https://community.atlassian.com/t5/Confluence-questions/Hide-items-in-option-menu/qaq-p/920803

https://community.atlassian.com/t5/Confluence-questions/Disable-CTRL-P-function-Prevent-Printing/qaq-p/1050179

https://stackoverflow.com/questions/6647392/how-to-stop-user-from-printing-webpages-using-javascript-or-jquery

 

0 comments

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Confluence

🥓🙅🏻‍♀️ Meet-less May Badge!

Hello Confluence Community!  What if i told you that you could have a healthier life and be 100% meet-less? This month, we're promoting a healthy, balanced work diet with Confluence. (Read m...

351 views 3 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you