0

Is there any way (Apex or SOQL) to get list of all the profiles with "Modify All" access for a given object ?.

For example I am interested in all the profiles in my org which has the "Modify All" access on Account object.

Currently I need to go through each and every profile and check whether this permission is set or not.

2

You'll want to target the PermisionSet and ObjectPermissions objects to find profile permissions in relation to objects. The example below should give you what you were looking for in regards to profiles with Modify All on Accounts.

SELECT PermissionSet.Profile.Name
FROM PermissionSet
WHERE Id IN (SELECT ParentId
             FROM ObjectPermissions
             WHERE SObjectType = 'Account' 
             AND PermissionsModifyAllRecords = true) 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.