Sub topic 11
Permissions, Field-Level Security, and Sharing
This chapter assumes you can build a basic report and know what a report type is. You should also know the difference between a custom report type that uses an inner join ("A with B") and one that uses an outer join ("A with or without B"). A report type decides which objects and fields a report can offer. It does not decide who sees which data. Several access layers do that, and they combine each time someone runs the report.
The layers that shape what a user sees
A report runs as a specific user. Salesforce applies these checks in order, and each check can remove something from the result:
- Can the user run or build reports at all?
- Can the user see the report, and the folder that holds it?
- Can the user read the objects in the report type?
- Can the user see each field?
- Can the user see each record?
Two people can open the same report built on the same report type and see different columns, different row counts, and different totals. That is expected behavior, not a bug.
User permissions for reports
The permissions that matter most:
| Permission | What it allows |
|---|---|
| Run Reports | Open and run reports the user can see |
| Create and Customize Reports | Build and edit reports in the report builder |
| Manage Custom Report Types | Create, edit, and delete custom report types |
| Export Reports | Export report data |
| View All Data | Read every record of every object, ignoring sharing |
Report types have no profile-by-profile assignment list. A deployed custom report type is offered to any user who can build reports and who has the required object access. Your main tools for limiting a report type are the deployment status and the object and field permissions, not the report type itself.
Folder access is separate. A user needs access to the folder that holds a report before they can run it. Folder access grants the Viewer, Editor, or Manager role on the report definition. It never grants access to the underlying records.
Object permissions and report type visibility
A report type lists one or more objects. For a user to work with it, the user needs Read access to the primary object. Related objects add another condition. A user without Read access to a related object cannot see that object's fields or records in the report.
Standard report types add one more option. If your org turns on the Standard Report Visibility setting (in the Reports and Dashboards settings), users see only the standard report types for objects they can read. With the setting off, a user can see a report type that includes objects they cannot read. This is confusing, so turn the setting on in orgs with sensitive objects.
Field-level security
Field-level security (FLS) controls whether a user can see or edit a specific field. Reports follow it directly:
- A field the user cannot see does not appear as a column choice.
- It cannot be used for grouping or summarizing.
- It is hidden even if the custom report type's field layout includes it.
The field layout of a custom report type and FLS work on different levels. The layout decides which fields are offered in the report type. FLS decides which of those fields a given user can actually see. Adding a field to the layout never grants access to it. Removing it from the layout hides it from everyone, even users with full FLS access.
A common surprise: you build a report for managers with a column such as Annual Revenue on the account. Another team runs the same report and the column is missing. The cause is FLS on that field for their profile or permission sets, not a problem with the report type.
Record sharing
Record visibility in reports follows the same sharing rules as the rest of the org. The user sees records they own and records shared with them through the role hierarchy, sharing rules, manual shares, and teams. The organization-wide default for each object sets the baseline.
Two permissions override this. View All Data lets a user see every record in every object. Modify All Data does the same and also allows edits. Users with either one see all rows.
How sharing interacts with join type
This is where report types and sharing meet. Sharing is evaluated for each object in the report, and the join type decides what happens when one side has no visible records.
- A with B (inner join). A row appears only if the user can see a record of A and a related visible record of B. If the user cannot see any contacts for an account, that account vanishes from the report.
- A with or without B (outer join). A row appears for every visible A record. If the user cannot see the related B records, the B columns are blank, and the A row still appears.
The two SOQL queries from the report type chapters make this concrete. Both run with the sharing of the user who runs them.
-- Matches an "Accounts with Contacts" report type:
-- only accounts that have at least one contact
SELECT Id, Name
FROM Account
WHERE Id IN (SELECT AccountId FROM Contact)-- Matches an "Accounts with or without Contacts" report type:
-- all accounts, plus any contacts they have
SELECT Id, Name, (SELECT Id, LastName FROM Contacts)
FROM AccountSuppose Account A has two contacts, but a sales user can only see the account, not those contacts. The first query leaves Account A out for that user. The second keeps Account A and returns an empty Contacts list. An administrator running either query would see the contacts, and the two results would match.
Where access problems appear
| Symptom | Likely cause | What to check |
|---|---|---|
| Column missing for some users | Field-level security | FLS on that field for the user's profile and permission sets |
| Fewer rows than an admin sees | Record sharing | Organization-wide defaults, role hierarchy, sharing rules |
| Account missing from "with" report | No visible related records | Sharing on the related object, or switch to "with or without" |
| Report type missing from the list | Object permission, status, or visibility | Read on the primary object, deployed status, Standard Report Visibility |
| User cannot save or edit a report | Missing report permission or folder role | Create and Customize Reports, Editor role on the folder |
| Totals differ between a dashboard and a report | Dashboard running user | Whether the dashboard runs as a fixed user or as the viewer |
Dashboards add one more rule. A standard dashboard shows data as seen by its running user, so every viewer sees the same numbers, even if they could not see those records themselves. A dynamic dashboard runs as the viewer and applies their access. Choose carefully when a dashboard is built on a custom report type that includes sensitive fields.
Design habits that avoid access surprises
- Put fields in the layout based on what the report's audience needs, then rely on FLS to protect sensitive fields. Do not remove sensitive fields from the layout and assume that protects them. A different report type may expose them again.
- Prefer "with or without" when the audience has different record access and you want stable row counts for the primary object.
- Use "with" only when you really want to exclude primary records with no related records.
- Test as a user with the lowest access level that will run the report.
- Document the intended audience in the report type description.
Exercise
A custom report type is "Accounts with Contacts". A sales user can see 40 accounts and can see contacts for only 25 of them. An admin runs the same report. How many accounts does the sales user get, and why?
Show answer
At most 25. The "with" join needs a visible contact for each account row, so the 15 accounts whose contacts the user cannot see drop out. The admin has full access, so the admin's count can be larger.
Exercise
You add the field Annual Revenue to a custom report type's field layout, but a service team still cannot see it in the report builder. What is the most likely cause, and where do you fix it?
Show answer
Field-level security hides the field from their profile or permission sets. The layout only offers the field. Grant read access to it in the field's FLS settings, or in a permission set, if the team should see it.
Exercise
A manager moves a report to a folder that every employee can view. Does this let employees who cannot see opportunity records read opportunity amounts through the report?
Show answer
No. Folder access only controls the report definition. Each user's object permissions, FLS, and record sharing still apply when they run it, so they see only what their own access allows.