Fix RfC Visibility to work as intended

The RfC Visibility of a consumer is intended to restrict who can access which RfCs. So far, those restrictions were only applied one way, for learners of a restricted consumer to view other (external) RfCs. However, the other way around should also work: If a RfC was created as part of a restricted consumer, no other external user should be able to interfere with this RfC. This commit, therefore, adds this direction as well and covers both directions with tests.
This commit is contained in:
Sebastian Serth
2023-07-13 10:51:10 +02:00
parent c6977b6319
commit e097036296
3 changed files with 207 additions and 99 deletions

View File

@ -4,7 +4,7 @@ FactoryBot.define do
factory :rfc, class: 'RequestForComment' do
user factory: :external_user
exercise factory: :math
submission { association :submission, exercise:, user: }
submission { association :submission, exercise:, user:, study_group: user&.study_groups&.first }
file
sequence :question do |n|
"test question #{n}"