1

I have a requirement where a lightning component should be displayed to 5 specific profiles and for other profiles it should not be visible.

How i can achieve this in lightning? Please guide me i am new to lightning.

Thanks!!

2 Answers 2

6

This can be done with no coding. Go to Lightning App Builder via 'Edit Page' option, select your component and in the properties panel on the right, specify the condition under 'Set Component Visibility'. See below screenshot for clarity:

enter image description here

Also, FYI: Winter 19 release extends this feature beyond Record and User fields by allowing Custom and Standard User Permissions as well (not Permission Sets).

4
  • Thanks for the reply kal,do i need to give the profile names separated by comma or semicolon in the value field ?
    – user46777
    Sep 12, 2018 at 7:01
  • I tried with the above solution that you provided by editing the page and providing the value as System Administrator but still this component is showing to other profiles also.Please guide.
    – user46777
    Sep 12, 2018 at 7:31
  • It will not work for tabs i read...As i have various tabs in my page....the filter visibility is not working....how i can proceed with this further.
    – user46777
    Sep 12, 2018 at 9:38
  • You could have up to 10 filters and set a combination of AND/OR conditions around them as well. And you are right, visibility filters aren’t supported for individual tabs inside the Tabs out-of-the-box standard component, but can be set for components housed within those tabs. If you want to show/hide the tabs along with the components, I am afraid you must resort to custom component via lightning:tabset and lightning:tab. Here is more info about 'Set Component Visibility': help.salesforce.com/… Sep 13, 2018 at 12:56
3

There are 2 ways

  1. Using Lightning Pages Activation: Whenever you create a lightnining pages you can make it available to certain profile and apps. This will make sure that the only certian profiles can see the page which has that components embedded. enter image description here

  2. Using Lightning component Visibility: Add that lightning component into all pages. Then in the visibility session of lightning component add visible only if profile is some certain profile.

enter image description here

You must log in to answer this question.

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