I use lightning:fileCard and e.lightning:openFiles components in my lightning component (that I use inside a community)

In 1 stage on my component, I wish to display a file preview, and to not give the user any option to change the file.


<tr onclick="{!c.filePreview}" style="cursor: pointer;" title="Click to preview file" id="{!v.ContentDocumentId}">


filePreview: function(component, event, helper) {
    var contentId = event.currentTarget.id;
        recordIds: [contentId]

QUESTION Is it possible to block access to update the file inside the file previewer?

enter image description here

1 Answer 1


I did some analysis and found these Delete, Edit, Upload New Version option came because user has these permissions on that record. If in sharing setting for that record is set with private and user has only viewers permission like : enter image description here

he would not be able to see these buttons : enter image description here

We can't hide them, these are controlled by permissions.

  • 1
    I do not understand what do you suggest to do - how do I remove file actions slds-file__actions-menu ? Commented Oct 16, 2018 at 8:25
  • Use slds-file slds-file_card and as a part part of customization don't add slds-file__actions-menu Commented Oct 16, 2018 at 8:27
  • I do not use any css - I use only the $A.get('e.lightning:openFiles') event which opens a standard component Commented Oct 16, 2018 at 8:30
  • @ItaiShmida please check my updated answer. Commented Oct 16, 2018 at 12:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .