If we choose the current Files integration to study, this works beautifully: when editing a group, if we set Public = Yes for the files integration, then the tab is visible to non-members; if we set Public = No, then the tab is not visible to non-members.
In the code, we find over 50 references to the $authorized function. Can you narrow down the lines that control the visibility of the tab and the referenced trigger?
Our code (that isn't working) is attached (kunena wouldn't allow it in the posting).
but setting our Public = Yes/No parameter, $posting_public, (Yes = 1, No = 0) to Yes or No is not affecting the tab visibility. Apparently, we are missing something crucial.