# How do Permission Sets provide flexible, modular privilege extensions without requiring profile duplication?

**Topic:** Admin · **Difficulty:** Medium · **Tags:** Admin, Permission Sets, Granular Access

Read it on the site: https://www.forcechallenges.com/interview-questions/how-do-permission-sets-provide-flexible-modular-privilege-extensions-without-requiring-profile-duplication

## Answer

**Basics:** A permission set is a collection of settings (object permissions, field permissions, system permissions, app/tab visibility, Apex class access, custom permissions, flows) that you assign to one or many users. They are purely additive: they can grant, never take away.

**How it works:**
1. Setup > Permission Sets > New; optionally choose a license (blank works for users of any license, or pick a license to unlock license-specific permissions).
2. Configure Object Settings, Field Permissions, System Permissions, Apex Class Access, App Assignments, etc.
3. Manage Assignments > Add users, or assign through API/Flow.
4. Effective access = profile permissions plus all assigned permission sets (union).
5. Permission Set Licenses unlock features such as add-ons.

**Advanced / deep dive:** Design permission sets around capabilities ("Can Approve Discounts", "Export Reports") rather than people, keeping them small and reusable, and bundle them in Permission Set Groups. Session-based permission sets activate only during a session after something like a step-up authentication or flow event, supporting least privilege. Assignment expiration dates are supported in recent releases (verify availability for your org). Because permissions are additive, to remove access you must remove the permission set or change the profile; a Muting Permission Set exists only inside Permission Set Groups. Track in version control; deploy with Metadata API (`PermissionSet`). Assign in bulk with Apex or Flow, and mind the user license compatibility: a permission set with a license can only go to users with a matching license.

**Code / config example:**
```apex
// Assign a permission set to many users (bulk-safe, skip existing assignments)
Id psId = [SELECT Id FROM PermissionSet WHERE Name = 'Discount_Approver' LIMIT 1].Id;
Set<Id> already = new Set<Id>();
for (PermissionSetAssignment a : [SELECT AssigneeId FROM PermissionSetAssignment
                                  WHERE PermissionSetId = :psId AND AssigneeId IN :userIds]) already.add(a.AssigneeId);
List<PermissionSetAssignment> toInsert = new List<PermissionSetAssignment>();
for (Id uid : userIds) if (!already.contains(uid)) toInsert.add(new PermissionSetAssignment(AssigneeId = uid, PermissionSetId = psId));
insert toInsert;
```

**Hidden gotchas & must-remember points:**
- Permission sets can only add access, never remove it.
- Profile plus permission sets gives the union of permissions.
- Page layout assignment is not in permission sets (profile-driven or Dynamic Forms).
- License mismatches block assignment.
- Deleting a permission set removes access from all assignees immediately.
- Permission set assignment changes via DML are setup-object DML; avoid mixing with non-setup DML in one transaction (mixed DML error).

**Best practice:** Small, capability-based permission sets, assigned through groups.

---
Source: ForceChallenges · last updated 2026-11-02
