Control Lightning Component Visibility Using Permission Set
Step 1: Create a Permission Set
- In Setup, search for "Permission Sets".
- Click New Permission Set.
- Fill the form:
- Label: Timer Component Visibility Permission
- API Name: Timer_Component_Visibility_Permission
- User License: Leave as --None-- (makes it accessible to all users)
- Click Save.
Step 2: Assign the Permission Set to Desired Users
- In the same Permission Set, go to Manage Assignments.
- Click Add Assignments.
- Select the users who should see the component.
- Click Assign.
Step 3: Apply Visibility Rule in Lightning App Builder
- Open Lightning App Builder for:
- Case Record Page or Opportunity Record Page (whichever applies)
- Select the custom Lightning component you want to control.
- In the right panel, scroll to Set Component Visibility.
- Click Add Filter → Choose:
- Advanced → User → Permission Set Assignments
- Then choose: Permission Set Name → equals → Timer_Component_Visibility_Permission
- Save the page and activate it (if not already done).