Skip to content

Commit

Permalink
No authorization in liveStreams(), as is expected in the tests. This …
Browse files Browse the repository at this point in the history
…does not affect the result, private live streams are not listed for students.
  • Loading branch information
YiranDuan721 committed Mar 24, 2024
1 parent 3cc3eb2 commit 87a7a21
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions api/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ func (r streamRoutes) getSubtitles(c *gin.Context) {

// livestreams returns all streams that are live
func (r streamRoutes) liveStreams(c *gin.Context) {
tumLiveContext := c.MustGet("TUMLiveContext").(tools.TUMLiveContext)

var res []liveStreamDto
streams, err := r.StreamsDao.GetCurrentLive(c)
if err != nil {
Expand All @@ -219,17 +217,11 @@ func (r streamRoutes) liveStreams(c *gin.Context) {
})
return
}

user := tumLiveContext.User
for _, s := range streams {
course, err := r.CoursesDao.GetCourseById(c, s.CourseID)
if err != nil {
logger.Error("Error fetching course", "err", err)
}
// Don't include private stream for non course admins
if s.Private && (user == nil || !user.IsAdminOfCourse(course)) {
continue
}
lectureHall := "Selfstream"
if s.LectureHallID != 0 {
l, err := r.LectureHallsDao.GetLectureHallByID(s.LectureHallID)
Expand Down

0 comments on commit 87a7a21

Please sign in to comment.