Implementing home page for different set of users based on their profile or app – profile can be done directly while activating the page. Also, assigning the Home page to the set of users based on values in their User record or other related records can be done by setting the component visibility and custom permission. Let us discuss more on how to build the home page for different users.
Home Page can be assigned as
- Org default: Assigned for all the users in the org.
- Apps and App – profile: Assigned to different apps and app with the selected profiles
If we want to show different set of components in Home page for different users, we can use ‘Set component visibility’ feature in lightning App Builder page to show or hide the component in home page.
Set component visibility:
Visibility for the component can be set based on
- Logged in User record fields
- Custom Permission
Using User record to set component visibility
- Choose the component in the Lightning Home Page builder and select set component visibility from left panel
- Click add filter –> Choose Field –> User –> Choose field required to filter (for Ex: Role)
- Provide the value for filter (for Ex: Admin)
- Activate the Page for the app or app – profile
Using Custom permission to set component visibility
Step 1: Create a Custom Permission
Setup –> Custom Permission –> New
Enter the permission information:
- Label – the permission label that appears in permission sets
- Name – the unique name that is used by the API and managed packages
- Description – optionally, a description that explains what functions the permission grants access to
- Connected App – optionally, the connected app that is associated with this permission
- Click Save
Step 2: Enable the custom permission to Permission set
- Create new Permission Set or choose an existing one for which you want to enable the custom permission
- In App section –> Choose Custom Permission to include the custom permission in Permission Set
- Select the available custom permission that needs to be enabled for permission set and then click Save
- Assign the permission set to the group of users who needs by clicking Manage Assignment
Use this Custom permission in Lightning Home Page to set visibility:
- Choose the component in the Lightning Home Page builder and select set component visibility from left panel
- Click add filter –> Choose Field –> Permission –> Choose Custom Permission
- Select the custom permission that created for set of users
- In criteria, choose the value true or false based on your use case — whether to show or hide the selected component
- Activate the Page for the app or app – profile
For Reference: