Custom Permissions : A way to find if a user is assigned a permission set

3:39 PM

Use Case:

Control component visibility on a lightning page. We would like to show a component on a lightning record page only when the user is assigned a specific permission set. We will use custom permissions to achieve this.

What is custom permissions?

Custom permission let you define your own permissions for use within your salesforce environment. You could then assign these permissions to either a permission set or a profile. More details here.

The Solution

Setup -> Custom Permissions . Create new and name it 'ShowAccountHighlights'

Create a new permission set or use an existing one. On the permission set overview page, click on Custom Permissions link and add the new custom permission you created.

On the user object create a new field of type formula and checkbox as formula return type.

Edit the lightning record page and set the component visibilty using the new field you created.

Now, just assign the permission set to a user to make this component visible for them.