How to Query Object Permissions for a Profile in Salesforce?

How to Query Object Permissions for a Profile in Salesforce?

Object Permissions for a Profile in Salesforce are stored in the ObjectPermissions Entity. 

Sample SOQL:

SELECT sObjectType, PermissionsCreate, PermissionsRead, PermissionsEdit, 
PermissionsDelete, PermissionsModifyAllRecords, PermissionsViewAllRecords 
FROM ObjectPermissions 
WHERE ParentId IN ( 
SELECT Id 
FROM PermissionSet 
WHERE PermissionSet.Profile.Name = 'System Administrator' 
)

Leave a Reply