To check the custom permission using Apex we can use the FeatureManagement class.
Demo:
Crate the custom permission
Sample Code:
Boolean bHasPermission = FeatureManagement.checkPermission('Test_Custom_Permission');
System.debug('has permission => '+bHasPermission);
Result:
No comments:
Post a Comment