Reject cross-organization Offline Transfer imports
What
Offline Transfer can currently import into a different organization than the one you're working in. This blocks that when either organization has isolation turned on. It's the same gap we already fixed for Direct Transfer, just in a different service.
How
Import::Offline::Imports::CreateService now checks each entity's destination org before creating the import. If the destination belongs to a different org than your current one, and either org is isolated, it returns a ServiceResponse.error instead of proceeding.
If neither org is isolated, nothing changes, so today's GitLab.com flows are unaffected.
Try it locally
- Two orgs A and B, a user in both, and a destination group in B.
- In the Rails console:
Organizations::Organization.find_by_path('org-a').mark_as_isolated! - As a user scoped to A,
POST /offline_importstargeting a group in B. It's rejected. mark_as_not_isolated!and it works again.
MR acceptance checklist
- I have evaluated the MR acceptance checklist for this MR.
Closes #600608 (closed). Part of &21584 (closed).
Follows the same isolated?-gated pattern as Direct Transfer in !236603 (merged) (#595674 (closed)), reusing its shared BulkImports::Error.cross_organization_destination helper.