diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index b8efab33e..2997f4205 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -842,7 +842,7 @@ class BidsController < ApplicationController # 编辑作业 def edit @bid = Bid.find(params[:bid_id]) - if (User.current.admin?||User.current.id==@bid.author_id) + if (User.current.admin?||User.current.allowed_to?(:as_teacher,@bid.courses.first)) @course_id = params[:course_id] respond_to do |format| format.html { @@ -884,6 +884,7 @@ class BidsController < ApplicationController def new_submit_homework #render html to prepare create submit homework find_bid + find_bid render :layout => 'base_homework' end