cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent some users to download files

ltardioli
Champ in-the-making
Champ in-the-making
Hello ppl,

I need to hide the download button from Share to all consumer users.
I was trying something like that:


<config evaluator="string-compare" condition="DocLibActions">
    <actions>
   <action id="document-download" type="link" label="actions.document.download">
      <param name="href">{downloadUrl}</param>
      <permissions>
        <permission allow="False">Consumer</permission>
      </permissions>
   </action>
     </actions>
</config>


But it didnt work…

Has anyone knows what permission I should use?

Thanks!
1 ACCEPTED ANSWER

niketapatel
Star Contributor
Star Contributor
Your configuration looks OK. Try to clear cache or may be restart server.

But this permission will hide Download button for All rather than only Consumers. Try this permission


<config evaluator="string-compare" condition="DocLibActions">
    <actions>
   <action id="document-download" type="link" label="actions.document.download">
      <param name="href">{downloadUrl}</param>
      <permissions>
         <permission allow="true">Write</permission>
      </permissions>
   </action>
     </actions>
</config>

View answer in original post

8 REPLIES 8

niketapatel
Star Contributor
Star Contributor
Your configuration looks OK. Try to clear cache or may be restart server.

But this permission will hide Download button for All rather than only Consumers. Try this permission


<config evaluator="string-compare" condition="DocLibActions">
    <actions>
   <action id="document-download" type="link" label="actions.document.download">
      <param name="href">{downloadUrl}</param>
      <permissions>
         <permission allow="true">Write</permission>
      </permissions>
   </action>
     </actions>
</config>

ltardioli
Champ in-the-making
Champ in-the-making
Hi niketapatel, this configuration works here! But when I open the document in view mode there is a download button too.
Do you know how to disable this button too? I couldnt figure how.

Thanks!

niketapatel
Star Contributor
Star Contributor
For that, you need to set this action permission


    <action id="document-view-content" type="link" label="actions.document.view">
            <param name="href">{viewUrl}</param>
             <permissions>
               <permission allow="true">Write</permission>
            </permissions>
         </action>

ltardioli
Champ in-the-making
Champ in-the-making
Hi Niketapatel! Thanks for your help!!
This code will hide the view button and I kind need that too!
But when I open a document by clicking in it, I mean the document detail's page there is an other download button on the top of the page; Do you know a way to hide this button too?

Thanks!

niketapatel
Star Contributor
Star Contributor
Hi, I believe this wont be done by configuration. You will have to modify/extend below webscript.

URL: /components/node-details/node-header

Thanks a lot! I will do that!!!

karlpogi
Champ in-the-making
Champ in-the-making

Noob here.. So we need to edit 3 things?

<config evaluator="string-compare" condition="DocLibActions">
    <actions>
   <action id="document-download" type="link" label="actions.document.download">
      <param name="href">{downloadUrl}</param>
      <permissions>
         <permission allow="true">Write</permission>
      </permissions>
   </action>
     </actions>
</config>
    <action id="document-view-content" type="link" label="actions.document.view">
            <param name="href">{viewUrl}</param>
             <permissions>
               <permission allow="true">Write</permission>
            </permissions>
         </action>

URL: /components/node-details/node-header

Where exactly are those files that we need to add those in located?

douglascrp
World-Class Innovator
World-Class Innovator

The first 2 xml sections should be included in the share-custom-config.xml file.

The last one will require an extension module to be created. For this, read the following thread