0

We have inserted LWC in visualforce page in classic using lightning out. Our requirement is to display the LWC to some profiles and users only. I set the component visibility filters through the lightning app builder, but it's not working for classic (lightning out). The LWC displays irrespective of visibility filters. I did not find any guidance online. It's not even mentioned in lightning out limitations. How can I make the LWC visible only to some users and profiles in classic (lightning out)?

2 Answers 2

0

The lightning app builder allows to create and customise lightning pages of type home, record and app. These pages are not available in Classic.

If you are adding any component in lightning pages, they are not going to be visible in Classic.

To show a visualforce page in Classic, You can add them to page layout. When your visualforce page is added to a page layout, it will be visible in both classic and lightning. You cannot apply standard component visibility filters to visualforce added to normal page layout.

In Order to apply visibility filter for visualforce page added into page layout to show it in classic, You need to handle it within the code.

Lightning pages available in: Lightning Experience and the Salesforce mobile app

Reference:- Dynamic Lightning Pages

0

Custom permissions can be used to display LWC in lightning out

Set a custom permission only to profiles that you want to display the component to. In VF page, check for the permission using $Permission and display the LWC.

Place this code in VF page where you display LWC using lightning out.

<apex:pageBlock rendered="{!$Permission.Potential_Duplicates_LWC}">
  <div id="lwcDemo" />  
</apex:pageBlock>

Refer this link

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .