How to fetch all Permission Sets where View All Data is true in Salesforce?

How to fetch all Permission Sets where View All Data is true in Salesforce?

To fetch all Permission Sets where View All Data is true in Salesforce, use PermissionsViewAllData as filter on the PermissionSet object/entity.

SOQL:

SELECT Id, Name, ProfileId, IsCustom, 
IsOwnedByProfile, PermissionsViewAllData, 
PermissionsModifyAllData 
FROM PermissionSet 
WHERE IsOwnedByProfile = false 
AND PermissionsViewAllData = true

Leave a Reply