Security & access

Who has Modify All Data in Salesforce? How to find every user (and cut the list)

By the orgadmin.ai team7 min read

Ask most admins how many people in their org can edit, delete or export any record, and they count the users on the System Administrator profile. The real answer is almost always higher. Modify All Data can come from a profile, from a permission set assigned years ago "just for the migration", or from a permission set group nobody looks inside. Integration users collect it too, because it makes errors go away.

This guide shows how to get the complete list in a few minutes, what else to look for while you are there, and how to remove the permission without breaking the people and integrations that rely on it.

Why Modify All Data matters so much

Modify All Data overrides sharing and object permissions. A holder can read, create, edit and delete every record of every object, regardless of the role hierarchy, sharing rules or record ownership, and can mass-delete or export data at scale. Turning it on also switches on the permissions it depends on, such as View All Data.

That is exactly what a system administrator needs, and exactly what an attacker wants from a stolen session or a leaked integration credential. Every extra holder is another account that can expose the whole org. Least privilege here is not box-ticking: it is the biggest single lever on how bad a compromised account can be.

Why "filter by profile" gives the wrong answer

Since Salesforce moved most access to permission sets, a permission can reach a user in three ways:

  1. Their profile. Behind every profile is a hidden permission set, the one marked owned by profile.
  2. A permission set assigned directly.
  3. A permission set group, which bundles several permission sets (and can mute permissions with a muting permission set).

A user-list view filtered by profile only catches the first. Setup has no single screen that answers "who holds this one permission, by any route". The data does exist, though, in the PermissionSetAssignment object, which records every assignment, including the profile-owned ones.

The SOQL query that finds every holder

Run this in the Developer Console, the Web Console, Workbench or any SOQL tool:

SELECT Assignee.Name, Assignee.Username, Assignee.Profile.Name,
       Assignee.LastLoginDate, PermissionSet.Label,
       PermissionSet.IsOwnedByProfile, PermissionSetGroupId
FROM PermissionSetAssignment
WHERE PermissionSet.PermissionsModifyAllData = true
  AND Assignee.IsActive = true
ORDER BY Assignee.Name

How to read the result:

  • PermissionSet.IsOwnedByProfile = true means the grant comes from the user's profile.
  • A value in PermissionSetGroupId means it comes through a permission set group. The group's combined permissions are what count, so mutes are already applied.
  • Anything else is a directly assigned permission set.

A user can appear more than once if they hold the permission by several routes. That matters: removing it from their profile does nothing if a permission set still grants it. Count distinct usernames for the headline number, but fix each row.

Drop Assignee.IsActive = true to see inactive users too. They cannot log in, but if one is reactivated they get the permission straight back.

Check the other "keys to the kingdom" while you are there

Modify All Data is the worst offender but not the only one. Swap the field in the WHERE clause to audit the rest:

Permission (API field)Why it is high-risk
View All Data (PermissionsViewAllData)Reads and exports every record, ignoring sharing
Manage Users (PermissionsManageUsers)Can create users, reset passwords and assign profiles, so can grant themselves anything
Assign Permission Sets (PermissionsAssignPermissionSets)Can hand out any permission set, including privileged ones
Manage Profiles and Permission Sets (PermissionsManageProfilesPermissionsets)Can add privileged permissions to existing profiles and sets
Customize Application (PermissionsCustomizeApplication)Changes org configuration, including automation that runs as system
Author Apex (PermissionsAuthorApex) and Modify Metadata (PermissionsModifyMetadata)Deploy code and metadata; in production that is a change-control question
Bulk API Hard Delete (PermissionsBulkApiHardDelete)Deletes records past the Recycle Bin

You can combine them with OR to get one list of every privileged user. In a sandbox, Author Apex and Modify Metadata are expected for developers; in production they deserve the same scrutiny as Modify All Data.

How many holders is too many?

There is no official number, but a useful rule of thumb: Modify All Data should sit with a small, named group of administrators, typically a handful of people, and never more than a few percent of active users. If your list is longer than your admin team, that is the finding.

Then look at each holder and ask:

  • Is this a person or an integration? Integration users are the most common surprise. Most integrations need specific object access, not every object.
  • When did they last log in? A dormant account with Modify All Data is a risk with no benefit. Assignee.LastLoginDate in the query above shows it.
  • Is the grant still needed? One-off projects (data migrations, a consultant's go-live) leave permission sets behind long after the work ends.
  • Is there a written reason? Auditors ask for one, and "they needed it once" is not it.

How to remove it without breaking anything

  1. Start with dormant and departed users. No one is relying on access they have not used in 90 days. Remove the permission, or deactivate the user if they have left.
  2. Replace, don't just revoke, for integration users. Build a permission set with only the objects and fields the integration touches, assign it, test the integration in a sandbox, then remove Modify All Data. Check the integration's error logs for a week afterwards.
  3. Move remaining admins off the profile grant. A "System Administrator" profile with Modify All Data, plus a separate admin permission set, makes it hard to see who really needs it. Many teams keep Modify All Data on one named permission set (or group) so that granting and revoking it is a single, auditable assignment.
  4. Use muting where groups grant too much. If a permission set group is mostly right but includes Modify All Data, a muting permission set inside the group removes it for everyone assigned to the group.
  5. Re-run the query. Confirm the count went down, and that nobody still holds it by a second route.

Then put it on the calendar. Privileged access drifts back up over time: a quarterly re-run is a good default (see how often to audit Salesforce security). Note that Salesforce's Health Check scores your org's security settings; it does not review who holds which permissions, so a good Health Check score says nothing about this list.

Doing it in orgadmin.ai

If you would rather not maintain the queries, Security Review runs this check as part of every review. For Modify All Data, View All Data, Manage Users, Assign Permission Sets, Author Apex and the other high-risk permissions above, it reports how many active users hold each one and splits them by route (via profile, direct permission set, or permission set group), with a sample of the usernames. Modify All Data is flagged critical when the holder count is more than 5% of active users (or more than three, in a small org). Author Apex and Modify Metadata are only flagged in production. Each finding is marked for manual validation, because only you know whether a holder has an approved business need.

To act on the list, User Management surfaces dormant users with elevated access and lets an owner or admin deactivate them in bulk, and the Permissions Workbench puts profiles and permission sets side by side so you can see and stage changes before anything is written. None of it removes permissions on its own: the decisions stay with you.

Checklist

  • Query PermissionSetAssignment, not the user list, so permission sets and groups are included.
  • Count distinct users, but fix every route a user holds the permission by.
  • Audit View All Data, Manage Users, Assign Permission Sets and the rest at the same time.
  • Remove it from dormant users first; replace it with scoped permission sets for integrations.
  • Keep Modify All Data on one named, auditable assignment.
  • Re-run the query every quarter.

Try it on your own org

orgadmin.ai puts an AI assistant, a security review and 21 more tools on your Salesforce org. 14-day free trial, no credit card.

Start free trial