[SalesForce] Disable access to “Delete”, “Edit”, “Upload New Version” on the file previewer

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.

MARKUP

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

CONTROLLER

filePreview: function(component, event, helper) {
    var contentId = event.currentTarget.id;
    $A.get('e.lightning:openFiles').fire({
        recordIds: [contentId]
    });
},

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

enter image description here

Best Answer

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.

Related Topic