#1659 修改助教点击编辑作业报403

This commit is contained in:
sw 2014-12-04 15:24:19 +08:00
parent 64497b10e4
commit 077476f39d
1 changed files with 2 additions and 1 deletions

View File

@ -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