I am planning to get read access for object with following query,
queryResults = connection.query("SELECT Assignee.Id, Assignee.Name" +
" FROM PermissionSetAssignment" +
" WHERE PermissionSetId" +
" IN (SELECT ParentId" +
" FROM ObjectPermissions" +
" WHERE SObjectType = GivenObjectType AND" +
" PermissionsRead = true)");
This is working for most of the salesforce objects. But for security related objects such as Groups, Profiles this is not working. (i.,e when I want to check users who can see user information, I should be able to pass GivenObjectType="User" and get all the users who can see other user's information.
Is there a way that I can achieve this?
Note: I identified following object types that doesn't have support in ObjectPermissions.SObjectType User, Group, Partner, Profile and Task (not a security related object)
Thanks!