Returns whether a user has been granted a permission on a permissions object.
The permission you wish to check
Optional flags to control the check.
Can be either 0 or PERMISSIONS_CHECK_SUPPRESSLOG to suppress log output of the check. Use PERMISSIONS_CHECK_SUPPRESSLOG in situations where you need to be performant or the generation of check messages would introduce unnecessary noise in the log files.