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!!
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:
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).
There are 2 ways
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.
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.
We can use the dynamic forms and then can set the component visibility of our LWC component to some specific profiles.