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:

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:

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".

PreferenceResult for files attached to records
OnUsers 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.
OffEvery 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:

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:

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.

  1. 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.
  2. 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.
  3. Upload as the owner. Attach a file to the test record from the Files related list, logged in as the file's owner.
  4. 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.
  5. 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.
  6. Flip the preference. In a sandbox, switch the preference and repeat steps 3 to 5. Compare the results with the table above.
  7. 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

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.