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?
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 withprivate
and user has onlyviewers
permission like :he would not be able to see these buttons :
We can't hide them, these are controlled by permissions.