5.51 regression: Permission issue on CRM_Mailing_BAO_Mailing::getGroupNames()
I have an extension "unsubscribe group token". From the description:
When using "ad-hoc" CiviMail, the "{mailing.group}" token evaluates to "Hidden Smart Group x". This evaluates identically to {mailing.group} on regular CiviMails, but evaluates to the unsubscribe group name on ad-hoc mails. This extension provides a token to display your "Unsubscribe from {group}" text appropriately.
This token calls CRM_Mailing_BAO_Mailing::getGroupNames()
, which @ufundo recently improved in #3463 (closed). However, this now requires the cron user to have the "Access CiviMail" permission.
Perhaps this should have always been the case. Perhaps I shouldn't be using CRM_Mailing_BAO_Mailing::getGroupNames()
from an extension. I'm not convinced that https://github.com/civicrm/civicrm-core/pull/23570 is wrong to check API permissions - but it is a regression.
I'll submit a PR, and if it feels inappropriate to merge, that's cool.