How to Check Logged in User has a Custom Permission in Salesforce

As of the Winter 18 Release, use the FeatureManagement class to identify the logged in User has a Custom Permission. below are the simple example to call the FeatureManagment

checkPermission(apiName) – Checks whether a custom permission is enabled.

Boolean hasPermission = FeatureManagement.checkPermission('CustomPermissionAPIName');

Note. You can also use the FeatureManagement.checkPermission method to check if the user has been assigned a custom permission without SOQL


Written by 

2x Salesforce MVP | Platform Champion | 18x Salesforce Certified | MuleSoft Certified | 8x Trailhead Ranger | TechForce Services | Sydney | Australia

Leave a Reply

Your email address will not be published. Required fields are marked *