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

how to disable download all attachment for specific page in confluence?

gadamchetty ramya October 26, 2017

Download all button should disable in attachments list .

is it possible to do without changing/modifying existing code

2 answers

1 vote
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 26, 2017

Hi there,

Nic is correct. If the users have access to view the attachments on the page then they also have the permissions to download them.

I created a feature request for this some time ago that you're welcome to watch and vote:

Otherwise, it will require that you modify the code to disable the add-on, which you were trying to avoid.

Let us know if you have any questions.

Kind Regards,
Shannon

gadamchetty ramya October 26, 2017

Thanks Shannon 

but as per my  requirement i have to modify the code ..i checked you modify the code doc..

they have mentioned need to edit .vm file and update with below code 

$generalUtil.htmlEncode($generalUtil.shortenString($attachment.fileName, 35))

how can we restrict for specific page as per above code
please help me on this  


Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 26, 2017

Hi,

You won't be able to restrict it; this is only to completely disable it.

To restrict it you only need to simply restrict who has permissions to access the page and its attachments. As long as someone has access to view the page and its attachments, they'll be able to download them.

Kind Regards,
Shannon

gadamchetty ramya October 26, 2017

shall i add some if condition to restrict specific page in .vm file ?

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 26, 2017

I'm not sure that's possible but you might be able to use a similar method as seen on Restricting users from the People Directory to specify a group that can have access.

Kind Regards,
Shannon

gadamchetty ramya October 26, 2017

Thanks Shannon

i will implement and update to you the status


Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 27, 2017

No worries,

To be clear, you won't be doing the exact same method as the above page but you can see how they restrict that specific function to a group. It may or may not work for your download button.

Kind Regards,
Shannon

gadamchetty ramya October 27, 2017

Thanks for you help

i can able to restrict download option for specific page .
using adding conditions in .vm file 

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 27, 2017

Great that you were able to do so!

Do you mind sharing the exact settings you added and to which vm file? That way, if other users run into this, they can use your example.

It would even be helpful to share that on the feature request.

Kind Regards,
Shannon

gadamchetty ramya November 21, 2017

sorry for the delay .

I have added condition like below in \ pages\includes\attachments-table.vm file 

 

<td class="filename-column">
#parse ("/pages/includes/attachment_icon.vm")
#if($generalUtil.htmlEncode("${req.contextPath}${attachment.downloadPathWithoutVersion}").contains("/download/attachments/3702788")) ->>3702788 is pageID
$generalUtil.htmlEncode($attachment.fileName)
#else
<a class="filename" href="$generalUtil.htmlEncode("${req.contextPath}${attachment.downloadPathWithoutVersion}")"
title="$generalUtil.htmlEncodeAndReplaceSpaces($attachment.fileName)">
$generalUtil.htmlEncode($attachment.fileName)
</a>
#end
</td>

Thanks,

Ramya

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 21, 2017

Ramya,

Thank you for letting us know! Users in the future will be able to see your response here and know how to avoid the download option.

Take care and kind regards,

Shannon

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2017

No.  If you don't want people downloading things, then don't put them on a page they can see.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events