Sub topic 5
Setting field access in Setup
This chapter assumes you know what profiles, permission sets, and object permissions are, and that field-level security (FLS) has two settings per field: Read and Edit. It covers the three places to set FLS in Setup, which to prefer, and the mistakes people make most often.
Three places to set FLS
You can set the same field access from three entry points:
| Entry point | Path in Setup | Best for |
|---|---|---|
| Field view | Object Manager > object > Fields & Relationships > field > Set Field-Level Security | Granting one field to many profiles or permission sets |
| Permission set | Permission Sets > set > Object Settings > object > Field Permissions | Granting many fields to one group of users |
| Profile | Profiles > profile > Object Settings > object | Baseline access that every user of the profile needs |
All three write to the same underlying data. A change in one place shows up in the others.
Setting FLS from the field
- Open Setup, then Object Manager, and choose the object.
- Select Fields & Relationships and click the field.
- Click Set Field-Level Security.
- For each profile, tick Visible (Read) and, if users should change the value, Read-Only left unticked.
- Save.
This view lists profiles. Permission sets are not shown here, so use the permission set editor to manage them.
Setting FLS in a permission set
- Open Setup and go to Permission Sets.
- Open the set, then Object Settings, and choose the object.
- Click Edit.
- Under Field Permissions, tick Read, and Edit if needed.
- Save.
Ticking Edit automatically ticks Read, because a user cannot edit a value they cannot see. Clearing Read also clears Edit.
How access is combined
Permissions are additive. If a profile grants Read and a permission set grants Edit, the user gets Edit. No setting can take away access that another grants, so removing access means removing the grant from every place that gives it.
Field access also depends on object access. A user with Edit on a field but no Read on the object still cannot reach that field.
Preferred approach
Keep the profile minimal and grant field access through permission sets. Access then follows job function and is easy to add or remove per user. Tools such as the Field Accessibility viewer (Setup > Field Accessibility) show which profiles can see a field, which helps when checking your work.
Common mistakes
- Granting Edit on a field to a profile and forgetting that a permission set elsewhere also grants it. Revoke at every source.
- Expecting a change on the page layout to hide the field from reports or the API. Layouts do not enforce security.
- Changing FLS on a field and assuming Apex code now respects it. Apex runs in system mode unless you enforce FLS, which a later chapter covers.
- Forgetting that standard fields and some system fields cannot have their access changed.
Exercise
A user's profile gives Read on Account.InternalNotes_c. A permission set assigned to the same user gives Edit on it. What is the user's effective access, and what must you do to make the field read-only for this user?
Show answer
The effective access is Edit, because permissions are additive. To make it read-only, remove the Edit grant from the permission set (or unassign the set) so only the profile's Read access remains.