个人主页,助教不可以关闭课程。修改张生代码

This commit is contained in:
sw 2015-07-24 14:36:53 +08:00
parent cf58ea8a9f
commit 4a781ea6b2
1 changed files with 1 additions and 1 deletions

View File

@ -604,7 +604,7 @@ class CoursesController < ApplicationController
def toggleCourse
@course_prefs = Course.find_by_extra(@course.extra)
unless (@course_prefs.student != User.current || User.current.admin?)
unless (User.current.allowed_to?(:as_teacher,@course_prefs) || User.current.admin?)
render_403
end
end