Delete Files that users don't own without giving "Modify All Data" Permissions - Ideas - Salesforce Trailblazer Community
Trailblazer Community

All Ideas

Idea Details

Post an Idea
9,580  Points
Idea has been posted. Give it an upvote or downvote.

Delete Files that users don't own without giving "Modify All Data" Permissions

Chatter & Files

Hi Community,
Delete Files that users don't own without giving "Modify All Data" Permissions.
as Modify All Data Permissions can't be given to users to just allow delete files of other users.There should be some way to allow user to delete files for records that they don't own.

Merge Idea · Flag

Latest Comment from Salesforce

  • Neil Hayek - 3 months ago

    I understand this change in behavior for Salesforce Files might be odd for those familiar with Attachments in Salesforce.

    An attachment could only be associated with one record, so it acted as if the record owned the attachment. If a user had sufficient permission on the record, they could delete the attachment to remove it from the record, even if someone else uploaded it.

    A File can be associated with multiple records, and ownership of the file is based on the person who uploaded it. Consider an example where sales or marketing material is uploaded to an opportunity. Someone with access to the opportunity likes it, and adds it to another opportunity they have access to. Someone working on the second opportunity might decide it isn’t relevant, so they want to remove it. If this user could delete the document, it would be removed from all locations it is associated, and the owner of the file could lose a copy of it.

    The way Files works with the above situation isn’t to delete the file from the second opportunity, but to remove it (un-share it). This way, it is no longer associated to the second opportunity, but will remain associated with the first. If it gets removed from the first opportunity as well, the file becomes private to the owner of the file. This helps prevent the loss of information, as the owner can still access the file from the Files tab. The owner (or an admin user) is able to completely delete the file from Salesforce.

    I understand there are situations where a document might need to be deleted from Salesforce, and not just be private to the owner. For these use cases, if it isn’t appropriate for an admin to delete the file, another option to consider is changing the file owner.

    Say a user leaves the company. Rather than keeping their files owned by that user, perhaps their manager should become the new owner. This would give them permission to delete the files as necessary. This could be done in mass through our API, or using a tool such as Data Loader.

    If you wanted the behavior to delete to be extended to users beyond the owner and an admin user, one option is to create Lightning Component and add it to the File detail page. This component could have a “Delete” button, and when pressed, it would change the owner of the file to the person who hit the button, and then perform a delete as the new owner.

    I hope this helps clarify why the delete option is restrictive for Files, but the option to remove a file from where it is shared is available to users who have collaborate permission on the file.

    You can make Files act more like Attachments by enabling the setting mentioned here:

    With this setting enabled, when a file is added to a record, collaborate access on the file will be inherited based on users with edit access on the record, and these collaborators will also have permission to remove the file from the record.
  • Upvotes
  • Downvotes



from AppExchange

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.