Source Code: Organizations - Snippets: Update snippet scopes to account for organizations
Remediation steps identified following audit of Organizations compatibility.
## Related Issues
* https://gitlab.com/gitlab-com/gl-infra/tenant-scale/organizations/organizations-feature-parity/-/work_items/11
## Description
Snippets by default pass through all project snippets unfiltered. Snippet model scope needs to be updated to filter by org by joining through projects.
## Issues Identified
* [ ] **`in_organization` scope bug (`app/models/snippet.rb:86-88`)**: The scope is `where.not(project_id: nil).or(where(project_id: nil, organization_id: organization_id))`. This passes through **all** project snippets from every organization unfiltered, while correctly filtering personal snippets. Since project snippets have `organization_id = NULL` by design (the table has a CHECK constraint enforcing exactly one of `organization_id`/`project_id` is non-null), filtering project snippets by org requires joining through the `projects` table to check `projects.organization_id`. `SnippetsFinder#by_organization` delegates to this same broken scope, so all finder paths that pass `organization_id` (Dashboard, Explore, API) inherit the data isolation gap.
* [ ] **3 dependent tables with `organization_transfer_support: todo`**: `snippet_repositories`, `snippet_statistics`, and `snippet_user_mentions` all have `organization_transfer_support: todo`. The `snippets` table itself is `supported`.
issue