---
title: "How do I control who can see uploaded files and attachments?"
space: "Framework"
url: "https://docs.frappe.io/framework/help/how-do-i-control-who-can-see-uploaded-files-and-attachments"
updated: "2026-11-20"
---

You attach a file to a record, mark it **Private**, and expect to decide exactly who can open it — by role, or by record. Private files don't have a role setting of their own: access always follows the record the file is attached to.

## **How it works**

Every attached file is either:

- **Public** — anyone with the direct link can open it, without logging in. Use this only for files that must render outside a login, such as a company logo on a printed invoice.
- **Private** — only a user who can already view the record the file is attached to can open it. The user who uploaded the file, and anyone the file was explicitly shared with, can also always open it.

There is no separate "give this role access to private files" switch on the File itself. A private file checks the permission of its parent record, every time it's opened. So "give the Sales User role access to private files on Sales Orders" and "give the Sales User role Read permission on Sales Order" are the same action.

If a private file was uploaded on its own and never attached to any record, only its owner (or an explicit share) can open it — not even a role with full access to every DocType.

## **Give a role access to a record's private files**

1. Go to **Role Permission Manager** (search it in the Awesome Bar, or **Users → Permissions → Role Permissions Manager**).
2. Set **Document Type** to the record the files are attached to — for example **Sales Order**.
3. Find the row for the role you want to change — for example **Sales User** — and check **Read**.
  ![](/files/pasted-image-bvuy1soe.webp)
4. Any user with that role can now open the record, and every private file attached to it.

To remove access, uncheck **Read** the same way. Removing Read also removes access to the record's attachments — the two cannot be split.

## **Narrow it further, or stop over-sharing**

- To limit a role to only some records of that type (for example, only their own territory or department), add a **User Permission** for that role and field rather than a second DocType permission — file access follows whatever the record permission resolves to, including User Permissions.
- If a user can see attachments you didn't expect, check what they can already read on the parent record first. A user who can open a Quotation can open every file attached to it, even one added by someone else — restricting the file means restricting the Quotation.
- To keep one file private to a specific person without changing anyone's role, use **Share** from the file or the record instead of a role change.
- The **File** DocType itself (the File Manager list, under **Home → Tools → Files**) is available to every logged-in user by design, since any user may need to attach files somewhere. You cannot turn that off from Role Permission Manager. What you control per record is whether a *specific* private file opens for a user who finds it there — the same Read check above still applies to each file's own listing.

## **Related**

- [Attachments](https://docs.frappe.io/framework/user/en/desk/attachments)
- [Users and Permissions](https://docs.frappe.io/framework/user/en/basics/users-and-permissions)