Check project.allowed_to_share_with_group? when fetching invited code owner groups

Related to https://gitlab.com/gitlab-com/request-for-help/-/work_items/3719+

In the GroupLoader we need to first check if the project can be shared with groups before fetching the groups.

Currently if a project is shared with a group and then the prevent sharing with groups setting is enabled, the code owner approval rules incorrectly assign these invalid groups as valid approvers.

See https://gitlab.com/gitlab-com/request-for-help/-/issues/3719#note_2901546851 for details on how to implement a fix.

Assignee Loading
Time tracking Loading