We have a Lightning Component button which allows Users to provide discounts on Opportunities.

We are currently leveraging the "Quick Action" functionality to display it on some page layouts.

The problem is that these layouts are available for Users who may neither have the Profiles ("Sales" or "Risk Ops") nor the Roles ("Vice President" or "Managing Director") which would allow the User to apply the discounts.

We have backend validation to ensure that the User will have either an appropriate Profile or an appropriate Role (it isn't necessary for the user to have both).

However, for good UX, we want to NOT DISPLAY the button unless the User is permitted to actually apply the discount.

I was looking in the Permission Sets, but I couldn't find any way to make buttons visible or invisible.

Is there a way to do this?

Or any ideas for good alternatives?

1 Answer 1


You could look at aura:if inside the component.

It enables things to be displayed if a condition returns true. I've used it to display different options for quick links to reports based on Record type.


access="global" >

<!-- Collection point of below "Record Data" -->     
<aura:attribute name="recordInfo" type="Object" />
<aura:attribute name="record" type="Object"/>
<aura:attribute name="recordError" type="String"/>
<!-- Necessary to collect field data and puts it in Attribute Above */ -->

<!-- START Queries All Fields!!! -->

<force:recordData aura:id="recordLoader"

<!-- /* Show Header based on RecordTypeId */-->
<aura:if isTrue="{!v.recordInfo.RecordTypeId=='012C0000000UmVLIA0'}">
<header style="font-size:25px;margin-bottom: -35px;">Header Text or Ltng 

  • That could hide the contents of the Lightning Component, but the QuickAction button would still display. Commented Sep 13, 2018 at 11:27
  • You could do a check to see if a user has particular rights, and if not, write an error message saying something as such. eg "This functionality is not available for your user".
    – DCole
    Commented Sep 21, 2018 at 2:42
  • I'm not looking to make the button ineffective, but to completely hide it. Commented Sep 21, 2018 at 6:14

You must log in to answer this question.

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