Convert hook_civicrm_checkAccess to civi.api4.authorizeRecord