Embedding GOUI doesn't work for subgroups
When embedding a link to a subgroup observability url, e.g. observe.gitlab.com/PARENT_GROUP/path?groupId=SUBGROUP, GOUI is not rendered.
This is also the case when embedding a link that is generated by the GOUI "Share" button, which shorten observe.gitlab.com/PARENT_GROUP/path?groupId=SUBGROUP to something like observe.gitlab.com/PARENT_GROUP/shortlink
Why is this happening?
When working on the access control (gitlab-org/gitlab!112021 (merged)) I did not take into account the case of parent vs subgroups ( I was not aware that accessing https://observe.gitlab.com/-/A_GROUP might redirect to observe.gitlab.com/PARENT_GROUP/path?groupId= A_GROUP
To check permissions, we currently parse the embedded link and retrieve the group from the base URL, not the query param ( i.e. getting PARENT_GROUP instead of SUBGROUP ).
After retrieving the group from the embedded link, we check if the user 1. can read the group 2. is a developer of the group and 3. if the feature flag is enabled for that group.
And the parent group might 1. not have the feature flag on 2. not be directly accessible for the user ( I think we need to explicitly check for that. See API)
Slack Discussion: https://gitlab.slack.com/archives/C02Q93U8J07/p1677092057842979?thread_ts=1677084507.871659&cid=C02Q93U8J07