个人主页,助教不可以关闭课程。修改张生代码
This commit is contained in:
parent
cf58ea8a9f
commit
4a781ea6b2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue