- Let's assume you have created a custom permission and it's been assigned to permission set or profiles.
- Now we can refer the same custom permission in apex to check whether it's enabled for logged in user or not.
- We use will the checkPermission() method from the FeatureManagement class for the same.
Boolean enabSet = System.FeatureManagement.checkPermission('Custom Permission APi Name');
System.debug('enabSet..'+enabSet);
Example:
Boolean enabSet = System.FeatureManagement.checkPermission('SreeTest'); System.debug('enabSet..'+enabSet);
Please comment or write us if you have any queries/requirements.
Please like,follow,bookmark,subscribe this site to receive daily updates.

ReplyDeleteWhen exploring options for customizing your apparel, consider the quality and ease of use of your supplies. Many professionals and hobbyists alike prefer to buy dtf transfers for their vibrant and durable results. These transfers ensure that designs are transferred smoothly onto fabric, making the process efficient and reliable. For those interested in enhancing their product offerings or personal projects, purchasing from a trusted source can make all the difference.