LiveChatButton entity is not accessible to guest user or portal user
Last updated 2020-11-20 ·Reference W-7839419 ·Reported By 18 users
In Review
Summary
From summer 20 release, LiveChatButton entity is not accessible to guest user or portal user. They can only be accessed through core users.
Repro
[1] Create a new Apex class with the following code
public with sharing class PreChatController {
public String query{get; set;}
public String testButton(){
List<liveChatButton> jup= [SELECT Id FROM LiveChatButton LIMIT 1];
query=jup[0].id;
return jup[0].id;
}
}
[2] Create a new VF page with the following code
<apex:page controller="PreChatController">
<apex:form>
<apex:commandButton action="{!testButton}"/>
<apex:outputPanel> {!query}</apex:outputPanel>
</apex:form>
</apex:page>
[3] Create a new site and set the above VF page as its home page
[4] You will notice that when Apex class is using with Sharing inheritance modifier the above page will result in unauthorized access page, and when it is used with without Sharing, the page loads fine.
Actual Result: Following error is thrown.
Authorization Required
You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it.
Expected Result: The chat has to be successful without any errors.
Workaround
Change apex inheritance to 'without Sharing' as a workaround
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.