From 5ee37f32e25ae7aa7736d624aaded80a49a2ef1b Mon Sep 17 00:00:00 2001 From: z9han Date: Tue, 23 Dec 2014 15:24:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AD=A6=E7=94=9F=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E3=80=81=E6=95=99=E5=B8=88=E5=88=97=E8=A1=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/courses_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 6e2c84e65..dee7af56d 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -56,7 +56,7 @@ class CoursesService else c = Course.find(course) end - if !(current_user.admin? || c.is_public == 1 || (c.is_public == 0 && current_user.member_of_course?(c))) + if current_user.nil? || !(current_user.admin? || c.is_public == 1 || (c.is_public == 0 && current_user.member_of_course?(c))) raise '403' end @teachers= searchTeacherAndAssistant(c)