From 2238c4282660311a22ce85dbbd241ab9225fd73e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 8 Oct 2014 11:42:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AE=9E=E8=B7=B5=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=9D=83=E9=99=90=E5=88=A4=E6=96=AD=E4=B8=8D=E5=85=A8?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 0ee9dc968..da527e552 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -470,9 +470,7 @@ class CoursesController < ApplicationController end def homework - if @course.is_public == 0 - render_403 - else + if @course.is_public != 0 || User.current.member_of_course?(@course) @offset, @limit = api_offset_and_limit({:limit => 10}) @bids = @course.homeworks.order('deadline DESC') @bids = @bids.like(params[:name]) if params[:name].present? @@ -490,6 +488,8 @@ class CoursesController < ApplicationController @bids = @bids.offset(@offset).limit(limit).all.reverse end render :layout => 'base_courses' + else + render_403 end end