How Field-Level Security Works with Roles
- Field-Level Security (FLS) controls whether a user can see or edit specific fields on an object, regardless of their record-level access.
- Roles primarily control record-level access through the role hierarchy and sharing settings, determining which records a user can view or edit.
- These two security layers work independently but together to enforce data access.
Key Points:
- Field Security is Profile- and Permission Set-Based, Not Role-Based
- Roles Control Record Access, Not Field Access
- Combined Effect: User Must Have Both Record Access and Field Access
- Example Scenario: A user in a Sales role can access Opportunity records owned by their team (role hierarchy). However, if their profile hides the "Discount" field on Opportunity, they won’t see or edit that field even on records they can access.
To Summarize:
Roles control which records you can access, while field-level security controls which fields you can see or edit on those records. Both must allow access for a user to interact with a field on a record.