Inaccessible groups are missing in the CI Job Token AllowList in the UI

When a project maintainer tries to inspect the CI Job token Allowlist in CI/CD settings and the Allowlist contains a group that the maintainer has no Guest+ permissions, the group is NOT displayed in the UI even though it exists.

This is misleading to the project maintainer because a group that can use the current project's CI Job Token Authorization exist but is NOT showing up in the list because the current user DOES NOT have access to the specific group

Steps to Reproduce

  1. For User A create a private_group_a
  2. For User B create a project_b.
  3. Give maintainer access to User B on private_group_a
  4. On project_b add a private_group_a to allowlist
  5. Check the allowlist it will have a private_group_a on it.
  6. Remove User B from maintainers of private_group_a
  7. As result private_group_a will disappear from the allowlist, it doesn't raise any errors like with none authoirized projects. But, it could be considered as a bug, as we still have a private_group_a in the allowlist if we will check ::Ci::JobToken::Allowlist.new(project_b).groups

References

  1. !178401 (comment 2307926117)
  2. !178401 (merged)
  3. #507309 (closed)