Acceptance tests: campus scope and permissions on media and playlists (#172) #174
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage#174
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Acceptance tests for #172, written before the implementation. Aetherforge holds #172 and is blocked until these exist (process: tests first, written by QA).
Add them to
crates/server/tests/permission_scoping_acceptance_integration.rs(or the follow-up file it already names), for a campus editor scoped to one campus and for an admin:campus_idis set from the user; creating in another campus or as "all" is refused.content_uploadis refused; playlist edit and device assignment withoutcontent_assignare refused.media_in_use) does not name playlists the user cannot see.These fail on
devtoday. Push them on a branch and open the PR, marked the way this suite already marks not-yet-implemented behaviour, so #172 can make them pass.Separate from your part on #157 (deadline Mon 16 Nov) — do #157 first if it is not done.
Order for Astraea: #175 first (deadline Mon 16 Nov), then this one. Chief of staff.
Acceptance tests added, fail-first confirmed against
dev(commit441951b), on branchtest/GRI-1980-media-playlist-permission-scoping:crates/server/tests/media_playlist_permission_scoping_acceptance_integration.rs— the "follow-up file"permission_scoping_acceptance_integration.rs's own header names. 25 tests, one per "Done when" bullet above (campus editor + admin where the bullet calls for it), modeled on the existing device-scoping tests.Command run:
Result against unimplemented
dev: 18 failed, 7 passed (25 total) — the 7 are the paired happy-path cases that already work today by coincidence (same-campus reads/writes, which need no scoping to succeed), kept as the paired "happy path" for each unhappy test per house style. Full failure output is on the board task (GRI-1980) for anyone who wants the raw panics; summary below.Criterion → test mapping:
may_access:a_campus_editor_lists_only_their_own_campuss_media(FAILED — HE media leaked),an_admin_lists_media_across_every_campus(ok),a_campus_editor_lists_only_their_own_campuss_playlists(FAILED — HE playlist leaked),an_admin_lists_playlists_across_every_campus(ok).a_campus_editor_deleting_another_campuss_media_gets_404_not_403(FAILED — got 204),a_campus_editor_can_delete_their_own_campuss_media(ok). Playlists:a_campus_editor_fetching_another_campuss_playlist_by_id_gets_404_not_403(FAILED — got 200),a_campus_editor_can_fetch_their_own_campuss_playlist_by_id(ok),a_campus_editor_updating_another_campuss_playlist_gets_404_not_403(FAILED — got 200),a_campus_editor_can_update_their_own_campuss_playlist(ok),a_campus_editor_deleting_another_campuss_playlist_gets_404_not_403(FAILED — got 204).campus_idfrom the user; refuses another campus or "all":a_campus_editors_media_with_no_campus_id_is_scoped_to_their_own_campus(FAILED — stored null),a_campus_editor_cannot_create_media_in_another_campus(FAILED — got 201),a_campus_editor_cannot_create_media_as_all_campuses(FAILED — got 201/null), and the identical three for playlists (all FAILED the same way).content_uploadrefused; playlist edit / device assignment withoutcontent_assignrefused:uploading_media_without_content_upload_is_refused(FAILED — got 201),updating_a_playlist_without_content_assign_is_refused(FAILED — got 200),replacing_playlist_items_without_content_assign_is_refused(FAILED — got 200),assigning_a_playlist_to_a_device_without_content_assign_is_refused(FAILED — got 200).a_campus_editor_cannot_assign_a_playlist_to_a_device_outside_their_campus(FAILED — got 200),a_campus_editor_can_assign_a_playlist_to_a_device_in_their_own_campus(ok).409 media_in_usedoes not name playlists the caller cannot see:the_media_in_use_conflict_does_not_name_a_playlist_the_caller_cannot_see(FAILED — HE playlist's name was in the body),the_media_in_use_conflict_names_a_playlist_the_caller_can_see(ok).Formatted (
cargo fmt) and clippy-clean (cargo clippy --test ... -- -D warnings) on this file. Fulllocal-gates.sh --rust-onlyis running now; will push once it's green. PR to follow, marked the way this suite already marks not-yet-implemented behaviour, so #172 can make these pass.CI is green on PR #177 (commit
475b247f): CI aggregate, clippy, fmt, cargo test, frontend-web, repository boundary, and the pre-push hook all passed. The one red leaf, cargo deny advisories, is a pre-existing dependency-advisory finding unrelated to this change — the PR touches no Cargo.toml/Cargo.lock, only the new test file. Moving to in_review. #172 can now build against these 25 fail-first acceptance tests.Closed: tests merged into dev by #177. Chief of staff.