Sub topic 17
Designing a maintainable access model
This chapter assumes you know how profiles, permission sets, permission set groups, and muting permission sets work, and that you can tell object permissions from record sharing. It covers how to combine those pieces so the model stays understandable after years of change.
What "maintainable" means here
An access model is maintainable when an administrator can answer three questions quickly:
- Why does this user have this permission?
- What will change if I edit this permission set?
- How do I give a new hire the right access without copying another user?
Most access models decay because answers to these questions are scattered. Profiles accumulate one-off edits, permission sets get created per request, and nobody knows which are still in use. The design rules below prevent that.
Start from a minimum baseline
Give every user a profile that grants almost nothing, such as Minimum Access - Salesforce. Add all real access through permission sets. The profile then only answers "what license is this person on," and every capability is visible in assigned permission sets.
Keep profile-only settings on the profile, since permission sets cannot carry them. Examples are page layout assignments, login hours, and login IP ranges. Keep these settings to a small number of profiles.
Layer the model
Use three layers of permission sets, each with a single purpose.
| Layer | Purpose | Example | Assigned to users directly? |
|---|---|---|---|
| Capability permission set | One focused capability | Account Viewer, Opportunity Editor, Export Reports | Rarely |
| Permission set group | A job function made of capabilities | Sales Representative | Yes |
| Exception permission set | A temporary or individual need | Q4 Forecast Override | Yes |
Assign groups to users, not individual capability permission sets. When the Sales Representative job changes, you edit one group and every holder is updated.
Naming and documenting
Names are the cheapest form of documentation. Pick a convention and apply it everywhere.
- Capability permission sets: name by object and verb, such as
Account_ViewerorCase_Escalation. - Groups: name by job function, such as
Sales_Representative. - Exception sets: prefix them, such as
TEMP_orEXC_, so they stand out in audits.
Fill in the Description field on every permission set and group. The Metadata API example from this tutorial includes a description element for this reason. Also record an owner and a purpose, even in the description text, so reviewers know whom to ask.
Use muting sparingly
Muting removes permissions from a group without editing the underlying permission set. This is useful when a shared capability set is nearly right for a job function. Overuse hides logic, because a user's effective access depends on a mute defined elsewhere.
A good rule: if you mute the same permission in several groups, the capability permission set is too broad. Split it into two sets instead.
Remember that muting affects only the group it belongs to. If the same permission set is also assigned directly to the user, or reached through another group, the permission still applies there.
Keep capability sets small and composable
A capability permission set should be small enough to name in a few words. Avoid sets such as "Sales Everything." Prefer sets that map to a feature or object area and combine in many groups.
Smaller sets also reduce risk. Granting Modify All Data or View All inside a broad set spreads a powerful permission to everyone who receives it. Keep powerful system permissions in dedicated sets, and review who holds them regularly.
Separate access to data from access to features
Permissions govern object and field access. Sharing governs which records a user can see. Keep these two concerns separate in your design.
- Use permission sets for CRUD, field-level security, and system permissions.
- Use org-wide defaults, roles, sharing rules, and teams for record access.
- Avoid
View AllandModify Allas a shortcut for a sharing problem. They override sharing for the whole object.
For feature gating in code, use custom permissions rather than checking profile names or user names:
if (FeatureManagement.checkPermission('Approve_Discounts')) {
// Show or run the discount approval logic
} else {
// Hide the feature or return an error
}The check works through profiles, permission sets, and groups alike, so you can change who gets the feature without changing code.
Plan for change
Deployment
Store permission sets and groups in source control as metadata and deploy them between environments. A group lists its permission sets by API name, so renaming a permission set later breaks references. Choose API names carefully at the start.
Recalculation
Editing a group triggers recalculation, and a group shows a status such as Updating or Failed. Make large changes outside business hours, and confirm the status returns to Updated before you rely on the result.
Review cycle
Schedule a recurring review, such as quarterly. Use SOQL to find permission sets with no assignees:
SELECT Assignee.Name, PermissionSet.Name, PermissionSet.Label
FROM PermissionSetAssignment
WHERE PermissionSet.IsOwnedByProfile = false
ORDER BY PermissionSet.NameCompare this list with the full list of permission sets. Sets that never appear in the results have no assignees and are candidates for removal. Also look for users with many directly assigned sets. That often means a job function is missing a group.
Common mistakes
| Mistake | Effect | Fix |
|---|---|---|
| Cloning a profile for each team | Dozens of near-identical profiles that drift apart | One minimum profile plus groups |
| Assigning capability sets one by one | Onboarding differs by person | Assign a group |
| Permanent exception sets | Access stays after the need ends | Prefix, set an owner, review |
| Using `Modify All Data` for convenience | Bypasses sharing and field restrictions broadly | Grant narrow permissions |
| Hard-coding profile names in Apex | Code breaks when profiles change | Use custom permissions |
A short design checklist
- Every user has the minimum profile, unless a profile-only setting needs a different one.
- Every real capability lives in a small, named permission set.
- Every job function has a group, and users get groups.
- Exceptions are labeled and reviewed.
- Record access is handled by sharing, not by View All or Modify All.
- All of it is in source control.
Exercise
A company has 40 cloned profiles, one per team. Onboarding a new sales rep means cloning an existing rep's access. Describe a replacement design and name one thing that must stay on a profile.
Show answer
Move every user to a minimum access profile. Build small capability permission sets for each object area or feature, bundle them into one permission set group per job function (for example Sales Representative), and assign the group to users. Use a muting permission set only where a group needs to differ slightly from a shared capability set. Page layout assignments, login hours, and login IP ranges must stay on a profile, so keep a few profiles for users who need those settings.
Exercise
The same permission is muted in five different groups. What does this suggest, and what should you do?
Show answer
The capability permission set grants more than most job functions need. Split it into two or more narrower permission sets, and add only the needed ones to each group. This removes the repeated mutes and makes each group easier to read.