function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Internal PartnerInternal Partner 

Use without sharing for @AuraEnabled Apex Controllers with Implicit Sharing salesforce

Hi all,

I am not a programmer. I just wanted to know if this critical update applies to us. Under Developer Console --> Search in Files I could not find "@auraEnabled", I guess this critical update doesn't apply to us and even if we don't activate it, Salesforce will activate it automatically.

Was my search correct or where else does it need to be analysed?
Raj VakatiRaj Vakati
I will be able to answer this question in multiple steps 

1. @AuraEnabled -> You can able to search from the developer console ... Looks like you dnt have any apex class that is annotated with @AuraEnabled .. So you cannt able to get the result ..

2.Yes .. Salesforce will auto active this critical update ..This critical update will be automatically enabled for all orgs on the auto-activation date, currently scheduled for after the Winter ’19 production release. The specific date for your org is available in the Critical Update Console in Setup.



All @AuraEnabled custom controllers run in system mode. Consequently, the current user’s credentials aren’t used to execute controller logic, and the user’s permissions and field-level security aren’t automatically applied.
You can choose whether a controller respects a user’s org-wide defaults, role hierarchy, and sharing rules by using the with sharing keywords in the class or method definition. For more information, see “Using the with sharing or without sharingKeywords” in the Apex Developer Guide.
By default, Apex classes that don’t specify either with sharing or without sharing in their definition implicitly use without sharing. That is, they behave as though without sharing was set.
However, Apex classes that don’t explicitly set with sharing or without sharing inherit the value from the context in which they are run. So when a class without explicit sharing behavior is called by a class that sets one of the keywords, it operates with the sharing behavior of the calling class.


https://releasenotes.docs.salesforce.com/en-us/spring18/release-notes/rn_lc_apex_implicit_sharing_keyword_cruc.htm
Internal PartnerInternal Partner
Thanks Raj for responding.