Salesforce Fact #107 | Apex sharing update
As part of a recent Spring'21 update, an @AuraEnabled apex controller will default to with sharing if no sharing is specified in the class declaration.
In this example, there is a lightning component which shows the count of account records the logged in user has access to. For this, an AuraEnabled method is written which returns the list of accounts. Since, no apex sharing is mentioned, it defaults to with sharing.
For more details, check: https://help.salesforce.com/articleView?id=release-notes.rn_lc_apex_with_sharing_cruc.htm&type=5&release=230
Attached are the screenshots.
Comments
Post a Comment