From 32157865381f1cb219bda6490b8801eadbf41f65 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 21 Nov 2014 11:33:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9D=9E=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=88=90=E5=91=98=E8=83=BD=E7=9C=8B=E5=88=B0=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index ac22ed412..178782da3 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -328,7 +328,7 @@ module CoursesHelper #当前用户是不是指定课程的学生 def is_cur_course_student course #course.members.joins(:member_roles).where("member_roles.role_id IN (:role_id) and members.user_id = #{User.current.id}", {:role_id => StudentRoles}).count != 0 - !(User.current.allowed_to?(:as_teacher,course)) + User.current.logged? && User.current.member_of_course?(course) && !(User.current.allowed_to?(:as_teacher,course)) #修改:能新建占位且不能新建任务的角色判定为学生 #is_student = false #@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))