- We are doing SOAP API (custom made apex webservice) calls to service using admin user.
- Those calls do search on Accounts (millions of records, search mostly on Name field)
- Account are set Private (org-wide) with many sharing rules and hierarchy sharing
- Calls pass userId (or email) of user in whose context result should be returned
Is there a way to apply sharing restrictions to the query I'm doing?
I have tried following:
- Use UserRecordAccess but it only allows to query for 200 records which is definitely not enough
- Use AccountShare table but it contains Groups for Role and Subordinates, which doesn't have any members in GroupMember table that means I would have to query for all the roles in role hierachy (which we have over 1000) also this table doesn't include sharing above in the hierarchy