非课程参与人员无法查看私有课程的测验列表

This commit is contained in:
cxt 2015-11-26 11:22:42 +08:00
parent 2b6cae5418
commit 6b72b4bb17
1 changed files with 4 additions and 1 deletions

View File

@ -5,8 +5,11 @@ class ExerciseController < ApplicationController
before_filter :find_course, :only => [:index,:new,:create,:student_exercise_list]
include ExerciseHelper
include ExerciseHelper
def index
if @course.is_public == 0 && !User.current.member_of_course?(@course)
render_403
return
end
remove_invalid_exercise(@course)
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
if @is_teacher