diff --git a/app/models/course.rb b/app/models/course.rb index aab3bab18d..01d9f37650 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -305,7 +305,7 @@ def open_for_user?(user) end def visible_for_user?(user) - visible_for_all? || (visible_for_institution? && institution == user&.institution) || user&.member_of?(self) + visible_for_all? || (visible_for_institution? && institution == user&.institution) || user&.member_of?(self) || user&.zeus? end def invalidate_subscribed_members_count_cache diff --git a/test/system/courses_test.rb b/test/system/courses_test.rb index 2634335f51..33a02da27c 100644 --- a/test/system/courses_test.rb +++ b/test/system/courses_test.rb @@ -57,4 +57,14 @@ class CoursesTest < ApplicationSystemTestCase # assert redirected to login page assert_selector 'h1', text: 'Sign in' end + + test 'zeus should see activities in hidden courses' do + course = create :course, visibility: :hidden, series_count: 1, activities_per_series: 1 + + sign_in users(:zeus) + visit(course_path(:en, course.id)) + + # assert activity table is visible + assert_selector '.activity-table' + end end