Who can see a file attached to a record in Salesforce?
Two settings decide who sees a file attached to a Salesforce record: the File Privacy on Records value on the file, and an org-wide preference that sets access by record. This article explains both and how to test them.
By Galacia ·
A user attaches a contract to an opportunity. Who else can open it? Salesforce's help describes attached files as shared with anyone who has access to the record. Two settings change what that means in practice, and a third thing, the user's access to the record itself, sits underneath both.
This article covers what "attached to a record" means, the two settings that decide who sees an attachment, what Viewer and Collaborator mean in practice, and a short way to test your own org. Everything here comes from Salesforce's help documentation, linked where it is used.
What "attached to a record" means
Salesforce's help says files attached to records are added to most Salesforce records through the Files related list, and that you can use them to share documents with anyone who has access to the record. In Lightning Experience, people choose Add Files on that list or drag files onto it.
Two practical points from the same page:
- To attach files to records, users need Read or Edit permission on the object.
- If the Files related list is missing, an admin has to add it to the page layout for that record type.
Note the phrase "anyone who can access the record". That is the default. The next two sections cover the controls that can change it.
Setting one: File Privacy on Records
Each file has a value called File Privacy on Records. The help article on making a file private on a record describes two values:
- Visible to Anyone With Record Access: anyone who can view the record sees the file in the Files section of the record's Related tab.
- Private on Records: only the file's owner sees it in that list.
Only admins and the file's owner can change this value. The file owner sees the attachment whatever the setting is. If the option is missing from the file's edit screen, the page says users need to ask an admin to add it.
The attach-files page says a file's visibility on a record is controlled by this setting, and that someone who can't see an attached file should ask the file owner to adjust it. If a user reports a missing file, check this value early.
Setting two: inherit record permissions
The second control is an org-wide preference. Salesforce describes it in Set File Sharing to Inherit Record Permissions. To find it, enter Files in Quick Find in Setup, then choose General Settings under Salesforce Files. The preference is called "Set file access to Set by Record for files attached to records".
| Preference | Result for files attached to records |
|---|---|
| On | Users with read/write access to the record, or with Modify All Data, get Collaborator access to the file. Users with read-only access to the record get Viewer access. |
| Off | Every file attached to a record defaults to Viewer access. |
The same page adds that files uploaded by guest users can only be given Viewer access.
The effect is that, with the preference on, anyone who can edit the record can also edit its attached files. With it off, every file attached to a record defaults to Viewer, so edit access to the record does not carry over to the file.
What Viewer and Collaborator mean
The permissions table in Who Can See My File? sets out what each level can do:
- Viewer: can view and preview, download, share and attach the file to a post.
- Collaborator: can do all of that, and can also upload a new version, edit details and change permissions.
- Owner: can do everything a Collaborator can, and can also make the file private, restrict access and delete it.
The inherit-record-permissions page adds that file owners and collaborators can change file permissions for people and groups.
The practical consequence is worth stating plainly. A Viewer can share a file. If your concern is who can pass a file on, the access level matters as much as who can see it in the first place.
Where the two settings meet
The pages describe each control separately. They do not set out, step by step, how the privacy value and the preference combine for a particular user, so this article does not guess. Read side by side, they describe two different jobs:
- File Privacy on Records decides whether people with record access see the attachment in the record's Files list.
- The org-wide preference decides what level of access people with record access get.
The "Who Can See My File?" page also notes that users with Modify All Data can do everything to files they don't own, except in private libraries, where only the owner has access. It adds that external users see files posted to records they can access, unless the post was marked "Internal Only". If you have an Experience Cloud site, include an external user in your tests.
An admin checklist for testing
Documentation tells you what Salesforce intends. A test tells you what your org does. Use two test users, if your org allows it.
- Pick the users. One user should have read/write access to a test record. The other should have read-only access, or none. If you use sandbox data, use a record that holds nothing sensitive.
- Check the preference. In Setup, open Files, then General Settings, and note whether "Set file access to Set by Record for files attached to records" is on. Write it down before you change anything.
- Upload as the owner. Attach a file to the test record from the Files related list, logged in as the file's owner.
- Test the default. Log in as each test user, open the record and look at the Files related list. Note what each can see, and whether they can edit the file or upload a new version.
- Test privacy. As the owner or an admin, choose Edit File Details and set File Privacy on Records to Private on Records. Check the Files related list again as each user. By the help page's description, only the owner should see the file in that list.
- Flip the preference. In a sandbox, switch the preference and repeat steps 3 to 5. Compare the results with the table above.
- Record the outcome. Keep a short note of the preference value, the privacy value and what each user could do. It will save time the next time someone asks.
Limits and caveats
- Private is not fully private. Salesforce's help carries an Important note: on private files, file metadata is not also private. A user without permission to open a private file can still reach its metadata. The page's own example is that an unpermitted user can see who is following the file. Do not rely on Private on Records to hide the existence of a file.
- Only admins and owners change privacy. If many files need the setting changed, plan who will do it.
- Existing files. The pages we read do not say whether changing the preference alters access on files that are already attached. Test that in a sandbox before you change it in production.
- Editions and experience. The attach-files page lists the editions where it applies, including Professional, Enterprise, Performance, Unlimited and Developer. Check your own edition on that page.
If your files are outside Salesforce
Galacia Vault puts a file component on Salesforce record pages. File contents are stored in cloud storage your organisation owns; the current assisted setup uses Amazon S3. Access to a record does not automatically grant access to its Vault files. The standard upload path is limited to 1.5 MB per file. Vault is sold with assisted installation, starting with a demo. Book a Vault demo.