Skip to content

Commit

Permalink
Don't show private VoDs on the course page to non course admins
Browse files Browse the repository at this point in the history
  • Loading branch information
YiranDuan721 committed Mar 24, 2024
1 parent fa96c9d commit ed5f5d1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/courses.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,14 @@ func (r coursesRoutes) getCourseBySlug(c *gin.Context) {
c.AbortWithStatus(http.StatusUnauthorized)
}

streams := course.Streams
user := tumLiveContext.User
var streams []model.Stream
for _, stream := range course.Streams {
if !stream.Private || (user != nil && user.IsAdminOfCourse(course)) {
streams = append(streams, stream)
}
}

streamsDTO := make([]model.StreamDTO, len(streams))
for i, s := range streams {
err := tools.SetSignedPlaylists(&s, &model.User{
Expand Down

0 comments on commit ed5f5d1

Please sign in to comment.