TUM-Dev / gocast

TUMs lecture streaming service.
https://live.rbg.tum.de/
MIT License
177 stars 41 forks source link

1266 private vods are still publicly listed #1340

Closed YiranDuan721 closed 2 months ago

YiranDuan721 commented 3 months ago

Motivation and Context

To prevent streams marked as "private" from being list anywhere (home page, course page and playlist) for a non course admin user. #1266 should be fixed with this. (Currently they are listed, but unauthorized visiting of the stream is then blocked by a 403 page)

Description

Changes are done to backend APIs. Private streams of one course are filtered out in the responses, if the user is not admin of that course.

Steps for Testing

I tested using the example database setup, with:

Pre-steps:

  1. Log in as Anja Admin
  2. Edit course "Einführung Brauereiwesen", mark "VL 2: Wie mache ich Bier?" as private
  3. Note that VL 2 is still listed everywhere

Tests:

  1. Log in as Stephanie Studi (or impersonate them in admin panel)
  2. Select the semester of course "Einführung Brauereiwesen" ("Summer 2022" under the example database setup)
  3. Check the homepage:
    1. The "most recent lecture" of "Einführung Brauereiwesen", listed under "My Courses", is dated at 11. Apr. 2022 (VL 2 at 18. Apr. 2022 is ignored)
    2. Under "Recent VODs", VL 1 is listed (VL 2 is ignored)
  4. Check the page for course "Einführung Brauereiwesen": VL 2 is not listed under "VODs"
  5. Watch VL 1, check the playlist: VL 2 is not listed there

Additional tests: Marking a stream without VoD (currently live, or planned in the future) as private is currently not supported, but can be done by direct edition in the database. If one does so, the private live stream / future lecture is as well then not listed

  1. on the home page in the "live" list
  2. on the home page as "next lecture" of the course
  3. on the course page under "scheduled"

Screenshots

1. Home page

As admin:

As student:

2. Course page

As admin:

As student:

3. Playlist

As admin:

As student:

github-actions[bot] commented 3 months ago

Your Testserver will be ready at https://1340.test.live.mm.rbg.tum.de in a few minutes.

Logins | Kurs1 | Kurs2 | Kurs3 | Kurs4 | | ---------------------------------------- | ------------------------- | ------------------------- | ------------------------- | | public | public | loggedin | enrolled | | prof1 | prof1 | prof2 | prof1
prof2 | | student1
student2
student3 | student1
student2 | student2
student3 | student1
student2 |