Since I couldn’t think of how to write this query off the top of my head, I thought it might be worth sharing. How can I query which
Readpermission on a specific object? I knew it would have something to do with
PermissionSet, but had to look up the documentation for both to piece it together.
The first query I got to work was on the
SELECT Parent.Profile.Name FROM ObjectPermissions WHERE Parent.IsOwnedByProfile = true AND SObjectType = 'MyObject__c'
This query gets exactly the data I wish, but in the Query Editor, gives the dreaded:
Left Inner Join to the rescue! More palatable:
SELECT Profile.Name FROM PermissionSet WHERE IsOwnedByProfile = true AND Id IN ( SELECT ParentId FROM ObjectPermissions WHERE PermissionsRead = true AND SObjectType = 'MyObject__c' )