Lightning Web Components can only import and call Apex methods that are accessible from outside the class. The @AuraEnabled annotation
marks a method as available for Lightning components, but the method must also have the proper visibility to be actually accessible.
When a method is marked as private or protected, it cannot be imported by Lightning Web Components, even if it has the
@AuraEnabled annotation. This creates a mismatch between the developer’s intent (making the method available to Lightning components) and
the actual accessibility of the method.
The Salesforce platform requires @AuraEnabled methods to be either public or global to ensure they can be
properly imported and called from Lightning Web Components using the ES6 import syntax.
What is the potential impact?
The method will not be accessible from Lightning Web Components, causing import errors or runtime failures when the component tries to call the
method. This can break the functionality of Lightning components that depend on these Apex methods.