Question:
How to check whether the user has access to a specified record from the database in Online CRM?
Answer:
Query the UserRecordAccess object in the database, specifying the RecordId and UserId. Check the permission information for the following fields:
- HasAllAccess
- HasDeleteAccess
- HasEditAccess
- HasReadAccess
- HasTransferAccess
The Salesforce Object Query Language (SOQL) appears as:
SELECT HasAllAccess,HasDeleteAccess,HasEditAccess,HasReadAccess,HasTransferAccess,RecordId FROM UserRecordAccess WHERE RecordId = '<record id>' AND UserId = '<user id>'
Related Documentation:
N/A