Security model: profiles, permission sets and sharing
Salesforce controls who can log in, which objects and fields they can use, and which individual records they can see. Learn the layers, how profiles, permission sets, roles and sharing rules fit together, and how to choose the right one.
A Salesforce org holds sensitive data: customers, deals, support cases. Not everyone should see everything. A barista at Brew & Bean should see today's orders, but not the owner's sales figures. A manager should see their team's orders but not another shop's.
Salesforce answers this with security in layers. Each layer can only narrow or widen what the previous layer allows, so you design from the tightest setting outwards.
The four layers
From outside to inside
| Layer | Question it answers | Main tools |
|---|---|---|
| Org and login | Can this person get in at all? | Passwords, multi-factor authentication (MFA), login hours, IP restrictions |
| Object level | Can they create, read, edit or delete this kind of record? | Profiles, permission sets |
| Field level | Can they see or edit this field on that object? | Field-level security (set on the field, applied through profiles and permission sets) |
| Record level | Which individual records can they see or change? | Org-wide defaults, role hierarchy, sharing rules, manual sharing |
Think of a building. The org and login layer is the main gate. Object permissions decide which floors you can enter. Field-level security decides which cabinets you can open in the room. Record-level sharing decides which individual folders in those cabinets are yours to read.
Object and field access: profiles and permission sets
A profile is a set of permissions assigned to a user. Every user has exactly one profile. It decides, among other things, object permissions (often called CRUD: Create, Read, Edit, Delete), which apps and tabs they can open, and which fields they can see.
A permission set is a bundle of extra permissions. A user can have many, and they only add access. A permission set group combines several permission sets into one package for a job role (for example, Barista or Shop Manager). A group can also include a muting permission set that switches off selected permissions in that group.
The current guidance from Salesforce is: give users a minimum-access profile, then grant what they need through permission sets and groups. This keeps the number of profiles small and access easy to review. Salesforce has been moving permission management away from profiles, so check the release notes and Help for your org's version.
Profile versus permission set
| Feature | Profile | Permission set |
|---|---|---|
| How many per user | Exactly one | Zero, one or many |
| Can it remove access | It sets the baseline | No, it only adds (use muting in a group to remove) |
| Best use | Baseline access for a type of user | Extra access for specific people or tasks |
| Setup path | Setup > Users > Profiles | Setup > Users > Permission Sets |
| Packaging | Cannot be grouped | Can be combined in a Permission Set Group |
Field-level security (FLS) is set on a field. In Object Manager, open the object, then Fields & Relationships, open the field and click Set Field-Level Security. For each profile you tick Visible and Read-Only. A field that is not visible is hidden from page layouts, reports and the API for that user. Hiding a field on a page layout is not security; FLS is.
Page layouts are not security
Removing a field from a page layout only hides it on that screen. The user may still get it from reports, list views or the API unless field-level security blocks it. Use FLS for anything sensitive.
Record access: who sees which records
Object permission says "you may read Coffee Orders". Record-level sharing says "which orders?". It starts closed and opens up. The ordering is important:
How record access is decided
- 1Org-wide defaults (OWD) set the most restrictive baseline for each object, in Setup > Security > Sharing Settings. Typical values: Private, Public Read Only, Public Read/Write, and Controlled by Parent (child follows the parent).
- 2Record ownership gives the owner full access to their own records (unless the object is master-detail child, which follows its parent).
- 3Role hierarchy lets managers see the records of people below them, when Grant Access Using Hierarchies is on. Set up in Setup > Users > Roles.
- 4Sharing rules open access to more records for groups of users, based on owner or on record criteria. They can only widen access.
- 5Manual sharing, teams and territories handle one-off cases, such as sharing a single order with a colleague.
A good rule: set the OWD to the most restrictive level any user needs, then open access up with roles and sharing rules. You can never use sharing to restrict below the OWD.
Example: Brew & Bean orders
| Need | Setting |
|---|---|
| Baristas see only orders from their own outlet | OWD for Coffee Order is Private; a role per outlet |
| Outlet manager sees all orders in their outlet | Roles: manager above baristas, with hierarchy access |
| Head office finance sees every order | Sharing rule to a finance public group, or View All permission (see below) |
| Only managers can cancel orders | A permission set that includes Delete or Edit on the Status field |
Roles are not profiles. A profile says what you can do (objects, fields, system features). A role says where you sit in the data-visibility hierarchy. Many mix them up in interviews. A simple test: if the question is "which records?" think role and sharing. If it is "which objects and fields?" think profile and permission sets.
Powerful permissions to be careful with
View All and Modify All on an object let a user see or edit every record of that object, ignoring sharing. View All Data and Modify All Data do the same across all objects. Give these only to the people who truly need them, such as integration users or administrators.
Apex code can ignore sharing unless a class is declared with sharing. Developers must choose this deliberately; the Apex lessons cover it.
Try it in your org
Give a barista read access only
- 1In Setup, open Permission Sets and click New. Label it
Barista, API nameBarista, and save. - 2Click Object Settings, open Coffee Orders, click Edit and tick Read and Edit (no Create or Delete). Then in Field Permissions, make Status editable. Save.
- 3Also give Read on Menu Items, and the Brew and Bean app under Assigned Apps.
- 4Click Manage Assignments on the permission set and assign it to a test user (create one in Setup > Users, with a minimum-access profile such as Minimum Access - Salesforce if available).
- 5From the user's detail page, use the Login button to log in as that user. Check what they can open, and log out to return.
Name permission sets after what they allow
Names like Manage Orders or Barista are easier to audit than Copy of Profile 2. Add a description. When you review access, you can then see why someone has it.
How this comes up in interviews
Common questions: "Profile versus permission set?", "What are org-wide defaults?", "Role hierarchy versus profile?", "How would you let a user see records they do not own?" and "Can sharing rules restrict access?" (No, they only widen it.) Practise answering with an example such as the Brew & Bean one above, in three short sentences.
I'm designing Salesforce security for [business, e.g. a chain of 5 coffee shops].
Users: [roles, e.g. baristas, outlet managers, head office finance].
Objects: [list of objects].
Rules: [who should see what, e.g. baristas only see their outlet's orders].
Propose org-wide default settings for each object, a role hierarchy, the permission sets (with object and field access) and any sharing rules. Put the answer in a table and explain each choice in one line.What to expect: Check that the answer uses OWD as the baseline and only widens with roles and sharing rules. If it suggests sharing to restrict access, it is wrong.
Try it: Design access for a college app
A college uses Salesforce to track Event and Registration records. Students should see only their own registrations. Event coordinators should see all registrations for events they run. The dean needs read access to everything.
Write down: the OWD for Registration, the roles, one permission set, and one sharing rule or setting for the dean.
Key takeaways
- Security has layers: login, object, field and record.
- Every user has one profile; permission sets (and groups) add access. Prefer minimum-access profiles plus permission sets.
- Field-level security protects fields. Removing a field from a layout does not.
- Record access: set the most restrictive org-wide default, then open it up with roles, sharing rules and manual sharing.
- Roles control which records, profiles and permission sets control what you can do. View All and Modify All bypass sharing.
Check yourself
Finishing the quiz marks the lesson as done.
1. A user can see an object but only some of their colleagues' records. Which setting is the baseline for record visibility?
2. Can a sharing rule give a user LESS access than the org-wide default?
3. You hide a salary field from the page layout. Is it now secure?
4. How many profiles can one user have, and how many permission sets?
5. A manager must see every order created by their team. What is the most fitting feature?
6. What does 'View All' on an object do?
Saved on this device. Create a free account to keep it on every device.
Practise this with Sam
A real mock interview, out loud, with an honest scorecard. Free to start.