|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
class Weapps::CoursesController < Weapps::BaseController
|
|
|
|
|
before_action :require_login
|
|
|
|
|
before_action :user_course_identity, except: [:create]
|
|
|
|
|
before_action :set_course, :user_course_identity, except: [:create]
|
|
|
|
|
before_action :teacher_allowed, only: [:edit, :update]
|
|
|
|
|
before_action :teacher_or_admin_allowed, only: [:change_member_roles, :delete_course_teachers]
|
|
|
|
|
|
|
|
|
@ -167,4 +167,9 @@ class Weapps::CoursesController < Weapps::BaseController
|
|
|
|
|
tip_exception(403, "..")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def set_course
|
|
|
|
|
@course = Course.find_by!(id: params[:id])
|
|
|
|
|
tip_exception(404, "") if @course.is_delete == 1 && !current_user.admin?
|
|
|
|
|
end
|
|
|
|
|
end
|