I have the following SOQL query:
SELECT Id, Name, Format, FolderName, LastModifiedDate
FROM Report
ORDER BY FolderName, Name
Which I am executing using this endpoint of the REST API:
/services/data/v35.0/query
Which works fine, except that it returns reports that the current user does not have access to.
How can I limit the results of this query to only include the reports that the user has access to?
The documentation mentions the UserRecordAccess
object and how it can be used as a foreign key in your SOQL queries, and includes this example:
SELECT Id, Name, UserRecordAccess.HasReadAccess
FROM Account
This however does not appear to work for Reports, as this query:
SELECT Id, Name, UserRecordAccess.HasReadAccess
FROM Report
Yields the following error:
SELECT Id, Name, UserRecordAccess.HasReadAccess
^
ERROR at Row:1:Column:18
Didn't understand relationship 'UserRecordAccess' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.