How to find user’s record access in Salesforce using UserRecordAccess object?

How to find user’s record access in Salesforce using UserRecordAccess object?

SOQL on UserRecordAccess entity can be used to find user’s record access in Salesforce.

SOQL Syntax:

SELECT RecordId, HasReadAccess, 
HasTransferAccess, MaxAccessLevel, 
HasAllAccess, HasDeleteAccess
FROM UserRecordAccess
WHERE UserId = '<User Id>'
AND RecordId = '<Record Id>'

Sample SOQL:

SELECT RecordId, HasReadAccess, HasTransferAccess, MaxAccessLevel, HasAllAccess, HasDeleteAccess
FROM UserRecordAccess
WHERE UserId = '0058c000007oEERAA2'
AND RecordId = '0018c000026ZmPmAAK'

Output:

Leave a Reply