How to modify Nextcloud to remove download/delete buttons

Hello Nextcloud forum,

Iā€™m very intrigued by your new fork of ownCloud! Iā€™ve been an ownCloud user for years now but in case I use ownCloud for a very specific purpose. Iā€™ll explainā€¦

In our office we put online (local lan only) all our Standard Operating Procedure documents (SOPā€™s) in PDF form. We donā€™t want our employees to download documents, the purpose of the SOPā€™s is to just read the documents on their workstations if need be. We ensure all our employees sign a confidentiality agreement, our workstations all run on a virtual machine so the thin client that they read the documents from do not have access to any downloaded documents so weā€™ve put some things in place to help us with people not accessing or copying downloaded material. Yes I knowā€¦all they need is a camera or cell phone and they can take a picture so no we donā€™t have a perfect system, but we have a system that has been working for us for many years. ownCloud displays within the the ownCloud PDF viewer our documents and we simply point ownCloud to a CIFS share so to update a document or add/remove a document is as simple as changing the PDF on the share (which only the owners have access to do this).

Where Iā€™m looking for added value from Nextcloud hopefully is to be able to clean up the interface for displaying our SOP documents. Iā€™ve been able to hack into the ownCloud code and remove some of the download buttons (like the big one at the top). But each individual document still has a download button beside it. Iā€™ve never been able through the ownCloud forums or feature requests received help in removing this functionality from ownCloud. I really want to make our document viewer system more professional looking. It looks like Nextcloud is going to allow me to skin it with our company logo more easily. I would really like to be able to remove some of the functions (like download and delete buttons) entirely for this single purpose to only display documents for reading on the workstation.

Would someone be able to direct me in the right direction here on where I can find if this type of change (either by myself by looking in the code or making a request to Nextcloud) is a feature that can be done within Nextcloud? I know the whole purpose of Nextcloud, just like ownCloud, is a document sharing repo so removing the download or delete buttons is counter intuitive to what these systems are built forā€¦but as a system whereby a company can ā€˜serve upā€™ documents for viewing only, I think this would be a very good feature to add to Nextcloud.

I hoping someone can point me in the right direction here on how I can attain this function within Nextcloud.

Thank you.

For the delete button, just remove the delete permissions from the share. But downloadā€¦

Because it is so good or because nobody has seriously tried?

I donā€™t know if you could create an app that can remove such options. That would be the best solution.

You can always do this manually but you have to do it again after each update. Firefox has the ā€œinspect elementā€-tool that points you at the source-code of a specific element. For the download button this would be:

<a href="#" class="menuitem action action-download permanent" data-action="Download">
<span class="icon icon-download"></span>
<span>Download</span></a>

Now you can search for that on github:
The first hit of Repository search results Ā· GitHub
shows you a list-template. So you could comment this part. Not sure if this is sufficient. If you start to disable parts of the code, it can break at other points or create errors.

3 Likes

Thank you for these repliesā€¦very much appreciated!

I forgot that removing the sharing option will remove the delete button. Good point. I have that covered then. :slight_smile:

As for the download buttonā€¦I agree that by creating my own app that could remove such buttons would be ideal. That way I could upgrade Nextcloud to new versions more easily. Any code changes that needed to be done within my app I could take care of after the upgrade. Iā€™ve used the inspect element in firefox and Chromes Inspect as well but I never had much luck with finding all the download button code for ownCloud (I did find the big download button code and was able to replace it).

I will dig into this some more and see what I can find. Thanks again for you suggestions and the link to the code on github.

Iā€™m looking forward to using Nextcloud more and moreā€¦

wow is good for our experience.

any one in here, can give better source to remove button download for nextcloud template?
i try in apps/files/templates/list.php , but source code nextcloud template is difference with github source https://github.com/nextcloud/server/search?utf8=āœ“&q=<span>Download<%2Fspan>

thanks