Skip to content

Instantly share code, notes, and snippets.

@TheShubhamVsnv
Created January 17, 2024 15:13
Show Gist options
  • Save TheShubhamVsnv/254f0b529e033a52bc48eecc39765e86 to your computer and use it in GitHub Desktop.
Save TheShubhamVsnv/254f0b529e033a52bc48eecc39765e86 to your computer and use it in GitHub Desktop.
/*
Record-level access in Salesforce defines the level of access a user has to individual records
within an object. This can be controlled through mechanisms like sharing rules, manual sharing,
criteria-based sharing, and ownership. Record-level access ensures that users can only view or
modify records for which they have the appropriate permissions.
*/
public class RecordAccessExample {
List<Account> accList = [SELECT Id, Name FROM Account WHERE OwnerId = :UserInfo.getUserId()];
// Accessing only records owned by the current user
// Code logic here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment