No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
UserRecordAccess
Represents a user’s access to a set of records. This object is read only and is available in API version 24.0 and later.
Supported Calls
describeSObjects(), query()
Fields
| Field | Details |
|---|---|
| HasAllAccess |
|
| HasDeleteAccess |
|
| HasEditAccess |
|
| HasTransferAccess |
|
| HasReadAccess |
|
| MaxAccessLevel |
|
| RecordId |
|
| UserId |
|
Usage
Use this object to query a user’s access to records. You can’t create, delete, or update any records using this object.
Up to 200 record IDs can be queried. You can include an ORDER BY clause for any field that is being selected in the query.
The following sample query returns the records, whether the queried user has read and transfer access to each record, and the user’s maximum access level to each record.
1SELECT RecordId, HasReadAccess, HasTransferAccess, MaxAccessLevel
2 FROM UserRecordAccess
3 WHERE UserId = [single ID]
4 AND RecordId = [single ID] //or Record IN [list of IDs]The following query returns the records to which a queried user has read access.
1SELECT RecordId
2 FROM UserRecordAccess
3 WHERE UserId = [single ID]
4 AND RecordId = [single ID] //or Record IN [list of IDs]
5 AND HasReadAccess = trueUsing API version 30.0 and later, UserRecordAccess is a foreign key on the records. You can’t filter by or provide the UserId or RecordId fields when using this object as a lookup or foreign key. The previous sample queries can be run as:
1SELECT Id, Name, UserRecordAccess.HasReadAccess, UserRecordAccess.HasTransferAccess, UserRecordAccess.MaxAccessLevel
2 FROM Account1SELECT Id, Name, UserRecordAccess.HasReadAccess
2 FROM Account- When the running user is querying a user's access to a set of records, records that the running user does not have read access to are filtered out of the results.
- When filtering by UserId and RecordId only, you must use SELECT RecordId and optionally one or more of the access level fields:HasReadAccess, HasEditAccess, HasDeleteAccess, HasTransferAccess, and HasAllAccess. You may include MaxAccessLevel.
- When filtering by UserId, RecordId, and an access level field, you must use SELECT RecordId only.