My application replicates data from Salesforce to my local disk. Initially, the admin downloads the entire dump. The other users will be able to access the entire dump. However, I wanted to enforce restrictions as Salesforce.com does.
Object level: A particular user may/may not have access to a particular object. This can be solved by calling getSObjects() and then viewing only the required objects from the dump. 1. This approach has a caveat where it is difficult to determine the ownership of the object if it was deleted from Salesforce. Is there a way to retrieve the metadata that shows that the user has access to this particular object?
Object level enforcement is still not sufficient as I would like to enforce the record level access too. For this, I would be needing UserRecordAccess to query. There are a few restrictions such as 200 record per query and it is not entirely retrievable. Is it possible to recreate the record level permissions? The reason is that there may be million of rows per object and querying permissions per id seems tedious.
This is the query that I have to run for record level permissions:
SELECT RecordId, HasReadAccess, HasTransferAccess, MaxAccessLevel FROM UserRecordAccess WHERE UserId = [xxx] AND Record IN [id list]