Skip to content

Commit ec3a6f5

Browse files
authored
Merge pull request #37 from janog-netcon/fix-audience-permission
観客の権限を更新した
2 parents bbd0fdc + 0e59ce6 commit ec3a6f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api/app/models/concerns/readable.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def readable_records(team:)
8181
return all if %w[Category Problem].include?(klass)
8282

8383
# 見学者なら一部のテーブルを除き全レコード取得可能
84-
return all if team.audience? && all_models(ignore: %w[Attachment Config Notice ProblemEnvironment]).include?(klass)
84+
return all if team.audience? && %w[Category Problem ProblemBody ProblemSupplement Team].include?(klass)
85+
return where(team: [nil]) if team.audience? && %w[Notice].include?(klass)
8586

8687
case klass
8788
when 'Answer'

0 commit comments

Comments
 (0)