An Apex Action for Lightning Flow that determines if a given user has been assigned a custom permission.
Flows can use the native global $Permission variable to determine whether the current user has a custom permission. This Action allows the flow to determine if any user has a custom permission.
There are multiple ways to install the action into one of your environments.
Click here to install this into a scratch org and try it out.
Click here to install the component to your sandbox.
Use one of these links to install the component as an unlocked package.
- Production or Developer orgs: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1U000007cCZgQAM
- Sandbox orgs: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t1U000007cCZgQAM
Installation using the sfdx cli and Shane McLaughlin's sfdx plugin
sfdx plugins:install shane-sfdx-plugins
sfdx shane:github:package:install -g scottmcclung -r nlib_Permission
Add an Apex Action element to your flow and choose 'User Has Permission?' in the Apex Action lookup field.
Provide the user id and the developer name (api name) of the custom permission to be checked for in the inputs tab.
Add a boolean variable that will receive the result of the check in the output tab.