You need to sign in to do that
Don't have an account?
Utkarsh Verma 22
Critical Update : Restrict Access to @AuraEnabled Apex Methods for Guest and Portal Users Based on User Profile
I created a custom login page which is actually a login form which is a lightning component and this uses an apex controller(class). I have also given user's profile access to apex controller(class). Also tried by using 'with sharing' and 'without sharing' keywords for class, but still getting the error:
Error message: You do not have access to the Apex class named 'MyApexController'
When I deactivated the critical update it is working fine. But when I activate it again it is not working. Please Help..!!
Error message: You do not have access to the Apex class named 'MyApexController'
When I deactivated the critical update it is working fine. But when I activate it again it is not working. Please Help..!!
Greetings!
As per the release notes,whenever the critical update activates then the guest user will not be able to access the Apex class until you give the access to the class on Guest user Profile.
Reference:https://releasenotes.docs.salesforce.com/en-us/winter20/release-notes/rn_lc_restrict_apex_guest_users.htm
I can see that you have already given the access to the Apex class.However,I would suggest you to double check if you have given the access to the correct guest profile.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
Have you already checked and confirmed that you have given the access on the Guest user profile with which you are trying to access on the community.
Thank you!
Also,if possible can you please share the screenshot of the Apex classes section.
>>Go to Sites>>Click on the name of the site>>Click on Public access settings and got to the Profile to see the classes under Apex class category.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Warm Regards,
Shirisha Pathuri