justin-lyon / jml-dx-box

Justin's running personal sfdx org
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Write an Apex class to check if any given User has a single Custom Permission #61

Open justin-lyon opened 1 year ago

justin-lyon commented 1 year ago

Salesforce has good support for checking the running user for a Custom Permission. However Salesforce does not have good support for checking any provided user for a Custom Permission.

Write a Custom Permission checker that accepts one user Id and one Custom Permission API Name, and return a Boolean TRUE if the User has the permission, or FALSE if the user does NOT have the permission.

Write an invocable apex class that applies this in bulk to a list of Users.