Ask a Salesforce team how many people can see every record in the org and the answer usually comes from the System Administrator profile: "four of us". Then you count the permission sets, the permission set groups, the integration users and the consultant who was given admin for a weekend in 2023, and the real number is three times that.
A handful of system permissions bypass sharing entirely or let the holder grant themselves anything else. This post lists them, gives the SOQL that counts every holder no matter how the permission was granted, and lays out a plan to bring the number down without breaking the people and integrations that genuinely need it.
The permissions that matter most
Most Salesforce permissions are scoped to an object or a feature. These have org-wide reach:
| Permission | API field | Why it is a superpower |
|---|---|---|
| Modify All Data | PermissionsModifyAllData |
Create, edit and delete every record regardless of sharing, plus broad administrative access |
| View All Data | PermissionsViewAllData |
Read and export every record regardless of sharing |
| Author Apex | PermissionsAuthorApex |
Deploy Apex, which runs in system context and can read or change data the user's own permissions would not allow |
| Customize Application | PermissionsCustomizeApplication |
Change objects, fields, automation and much of Setup |
| Manage Users | PermissionsManageUsers |
Create users, reset passwords and change profile and permission set assignments, which is a short step to any of the above |
A second tier deserves the same review: View All Users, Manage Sharing, Manage Profiles and Permission Sets, Assign Permission Sets, Use Any API Client and Approve Uninstalled Connected Apps. The last two decide which OAuth apps a user can authorize, which mattered a great deal during the 2025 OAuth token thefts.
Why counting profiles is not enough
Permissions reach a user in three ways: their profile, permission sets assigned directly, and permission set groups. The useful detail is that every profile has a hidden permission set behind it (IsOwnedByProfile = true), and every permission set group has an aggregated permission set of its own. So one object, PermissionSetAssignment, covers all three routes. Salesforce's own developer blog uses the same approach in auditing privileged users with SOQL.
The query
List every active user who holds Modify All Data or View All Data, and how they got it:
SELECT Assignee.Username, Assignee.Profile.Name, Assignee.LastLoginDate,
PermissionSet.Name, PermissionSet.IsOwnedByProfile, PermissionSetGroupId
FROM PermissionSetAssignment
WHERE Assignee.IsActive = true
AND (PermissionSet.PermissionsModifyAllData = true
OR PermissionSet.PermissionsViewAllData = true)
ORDER BY Assignee.UsernameRun it with the CLI and keep the output:
sf data query --target-org prod --result-format csv \
--file superpowers.soql > superpowers.csvRead the result in three columns. IsOwnedByProfile = true means the grant came from the profile. A populated PermissionSetGroupId means it came through a group. Anything else is a directly assigned permission set. A user appears once per route, so one person with both a profile grant and a permission set appears twice, which is itself worth knowing.
For a headline number per permission, count distinct users:
SELECT COUNT_DISTINCT(AssigneeId) holders
FROM PermissionSetAssignment
WHERE Assignee.IsActive = true
AND PermissionSet.PermissionsAuthorApex = trueSwap the permission field to get Author Apex, Customize Application and Manage Users counts. Then do the per-object version, which is where integration users usually hide:
SELECT Parent.Name, Parent.IsOwnedByProfile, SobjectType,
PermissionsViewAllRecords, PermissionsModifyAllRecords
FROM ObjectPermissions
WHERE PermissionsViewAllRecords = true OR PermissionsModifyAllRecords = true
ORDER BY SobjectTypeView All Records on Contact is not Modify All Data, but on the objects that hold your customers' personal data it is close enough to treat the same way.
Reading the list
Put every holder into one of five buckets:
- Named administrators. People whose job is running the org. They need the access, but each should be a named individual with MFA, not a shared login.
- Integration users. Accounts used by middleware, ETL and connected apps. These almost never need org-wide data access, and they are the accounts whose tokens get stolen.
- Package users and package permission sets. Grants that came in with a managed package. Some are needed; many were accepted at install without anyone reading them.
- Leftovers. Former consultants, people who changed roles, accounts that have not logged in for months.
- Break-glass. A deliberately held emergency account, ideally frozen until needed.
LastLoginDate sorts bucket four out quickly. Anyone holding Modify All Data who has not logged in for 90 days should lose it this week.
A least-privilege plan that sticks
Replace, do not just remove. If an integration needs to update Opportunities and read Accounts, give it a permission set with exactly that object access, plus View All Records on the one object it must see in full, if any. Removing Modify All Data without a replacement breaks the integration and gets the permission put back.
Split admin work. Many people with System Administrator only need to manage users, or reports, or flows. Delegated administration and narrower permission sets cover most of it.
Make temporary access temporary. PermissionSetAssignment has an ExpirationDate, so a grant for a migration or an investigation can end on its own instead of on someone's memory.
Watch for new grants. Setup Audit Trail records permission set assignments and profile changes. Review those entries weekly, because the count you just reduced will grow back otherwise.
Watch the groups. A permission set group can add up to Modify All Data even when no single member set grants it. Review the group, not just its parts.
Counting with Vulkro for Salesforce
The live-org audits run the same reads through your own sf CLI login and change nothing:
vulkro-sf org effective-perms --target-org prod
vulkro-sf org psg-composition --target-org prod
vulkro-sf org least-privilege --target-org prod --days 90 --xml-out ./suggested-permsetsorg effective-perms reports SF-PERM-ASSIGN-001 for every custom permission set that grants Modify All Data, View All Data, Author Apex or Manage Users and is held by an active user, naming each holder, and SF-OBJ-PERM-001 for View All and Modify All on objects, weighted by how many active users hold the grant. It skips standard profiles such as System Administrator and managed permission sets, so count those with the SOQL above. org psg-composition reports SF-PSG-COMPOSITION-001 when a group's members add up to full data access. org least-privilege ranks users, especially integration and API-only users, by what they can reach against the usage evidence the org exposes, flags SF-LP-INTEG-001 and the dormant administrator check SF-PERM-002, and writes a suggested permission set XML per user for you to review. Nothing is deployed, and without Event Monitoring it marks record access as "review" rather than claiming it is unused.
FAQ
How do I find who has Modify All Data in Salesforce?
Query PermissionSetAssignment where PermissionSet.PermissionsModifyAllData = true and Assignee.IsActive = true. Because profiles and permission set groups each have an underlying permission set, that one query covers grants from profiles, permission sets and groups.
What is the difference between View All Data and View All Records?
View All Data is a system permission that bypasses sharing on every object. View All Records is an object permission that bypasses sharing on one object only. Both ignore sharing rules, so both belong in a least-privilege review.
Should an integration user have View All Data?
Rarely. Most integrations read a few objects and need object permissions for those, with View All Records only where they truly must see every record. Org-wide access on an integration user turns one stolen token into a full data export.
See the org effective-perms reference and the org least-privilege reference, or start a 14-day trial. Related: moving permissions from profiles to permission sets and Salesforce integration users and least privilege.