Skip to content

Add tests for per-mission DrawTool file isolation (#1094) #1125

Open

Description

@jl-0

Summary

#1094 scoped DrawTool files by mission (user_files.mission column, mission param on /api/draw/files/getfiles, /make, /change, and per-mission showNullMissionFiles / showMasterFiles DrawTool variables). It shipped without automated tests. This issue covers the test coverage needed to verify cross-mission isolation and close out JIRA IDS-10388 for D56.

Tests to add

/getfiles

  • File created under mission A is not returned when querying with mission: B
  • File created under mission A is returned when querying with mission: A
  • Legacy files (mission = NULL) are returned when showNullMissionFiles is unset/true, and excluded when false
  • Master files (is_master = true) are returned when showMasterFiles is unset/true, and excluded when false (including master files belonging to the same mission)
  • Unknown mission returns status: "failure" ("Unknown mission")
  • Private files of another user remain hidden regardless of mission (existing file_owner/public filter still applies)
  • Document/assert behavior when mission is omitted (currently returns files from all missions, so isolation depends on the client sending mission)

/make

  • mission is persisted on the new file
  • Unknown mission is rejected
  • Omitted mission creates a NULL-mission (legacy) file

/change

  • A lead (mmgis-group) can move a file to another existing mission
  • A non-lead cannot change a file's mission
  • Moving to an unknown mission is rejected

Migration / legacy data

  • ALTER TABLE ... ADD COLUMN IF NOT EXISTS mission is idempotent on user_files and user_files_tests, and pre-existing rows come through as mission = NULL and stay visible by default

Frontend

  • DrawTool sends the current mission on getfiles/make (Playwright: create a file in mission A, switch to mission B, confirm it isn't listed)

Notes

Refs: #1094 · JIRA IDS-10388 (D56)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions