12-24-2020 01:45 AM
Hello,
I am new with alfresco, I want the consumer can only read not download. I've disabled most of the download buttons but I need to disable the Download button (only appear when there is multi versions) and the href link with F12 (No matter if there is multi versions) in Version History for Consumer as well. I didn't find any threads about this, how can I achieve this? Could you please help? Thanks.
<div class="version-panel-right">
<span class="actions"> <a href="http://192.168.76.29/share/proxy/alfresco/api/node/content/versionStore/version2Store/edf39dd7-63bc-..." target="_blank" class="download" title="下载"> </a>
</span>
12-24-2020 07:25 AM
What you mean by disable using F12?
Do you want to change in code and then disable?
12-24-2020 08:03 AM
Dear sanjaybandhniya,
Please refer to below picture, I want to disable the download button(circled in red color) in version history for consumer.
And for this version history, I found that the user can get the actual URL from Browser's developer tools by click F12. Please refer to below picture, copy that URL and login with consumer also be able to download the file.
Pls help. Thanks a lot.
12-25-2020 06:40 AM
You need to override getDocumentVersionMarkup method \components\document-details\document-versions.js file to disable download.
12-29-2020 01:55 AM
Hi sanjaybandhniya,
Actually I have tried this method before I posted this post. I tried to change the downloadURL and html value in document-versions.js as below. But the result is it still shows the URL same as previous
<a href="http://192.168.76.29/share/proxy/alfresco/api/node/content/versionStore/version2Store/edf39dd7-63bc-..." target="_blank" class="download" title="下载">.
Looks like I didn't do the correct way. Could you please explain more details on how to override getDocumentVersionMarkup method? Thanks a lot.
getDocumentVersionMarkup: function DocumentVersions_getDocumentVersionMarkup(doc) { // var downloadURL = Alfresco.constants.PROXY_URI + 'api/node/content/' + doc.nodeRef.replace(":/", "") + '/' + encodeURIComponent(doc.name) + '?a=true',html = ''; var downloadURL = 'xxx',html = 'yyy'; html += '<div class="version-panel-left">' html += ' <span class="document-version">' + $html(doc.label) + '</span>'; html += '</div>'; html += '<div class="version-panel-right">'; html += ' <h3 class="thin dark" style="width:' + (Dom.getViewportWidth() * 0.25) + 'px;">' + $html(doc.name) + '</h3>'; html += ' <span class="actions">'; if (this.options.allowNewVersionUpload) { html += ' <a href="#" name=".onRevertVersionClick" rel="' + doc.label + '" class="' + this.id + ' revert" title="' + this.msg("label.revert") + '"> </a>'; }
12-29-2020 07:57 AM
I haven't tried.
Workaround solution is create same file at same path with your change. This is not properr way to override.
May be you will get better solution from other member.
12-29-2020 11:59 PM
Hi Sanjay,
I got advice that I need change the document-versions.min.js instead of document-versions.js. After I set the html value to null, the download button can be disabled, but the upload button is still there. Do you know how can I hide the upload button as well?
Regards
Alan
12-30-2020 10:44 PM
That icon/functionality you can disable/remove from document-versions.get.html.ftl file.
Explore our Alfresco products with the links below. Use labels to filter content by product module.