There is a method
FeatureManagement.checkPermission to check efficiently if a user has a custom permission.
How can we check efficiently if a user has a standard permission instead?
For example, when I try to find if a user has
Manage Profiles and Permission Sets permission and when I run the following code under system administrator user
System.debug(LoggingLevel.ERROR, '@@@ v: ' + FeatureManagement.checkPermission('ManageProfilesPermissionsets') );
@@@ v: false
results despite system administrator has
Manage Profiles and Permission Sets permission.