mailing acl permission check via php api
When trying to send mail via cv api job.process_mailing, or drush (using drush civicrm: https://www.drupal.org/project/civicrm_drush/issues/3290970#comment-14578047), CiviCRM generates an error "API permission check failed for Group/get call; insufficient permission: require access CiviCRM"
There are two sort-of work arounds with cv: either of "cv api job.execute" (if that job is enabled) or "cv --user=admin api job.process_mailing" (where admin is the cms username of an admin-permissioned user).
When inserting breakpoints to try and understand what's going on, it appears that the failure is happening here:
It's unclear to me why the two work-arounds avoid this.
Conclusion: the process_mailing job is demanding too many permissions when invoked via the php api.