修改超级管理员可以访问课程作业列表

This commit is contained in:
sw 2014-11-28 16:16:22 +08:00
parent 5854c2731f
commit 179b6852da
1 changed files with 1 additions and 1 deletions

View File

@ -485,7 +485,7 @@ class CoursesController < ApplicationController
end end
def homework def homework
if @course.is_public != 0 || User.current.member_of_course?(@course) if @course.is_public != 0 || User.current.member_of_course?(@course) || User.current.admin?
@offset, @limit = api_offset_and_limit({:limit => 10}) @offset, @limit = api_offset_and_limit({:limit => 10})
@bids = @course.homeworks.order('deadline DESC') @bids = @course.homeworks.order('deadline DESC')
@bids = @bids.like(params[:name]) if params[:name].present? @bids = @bids.like(params[:name]) if params[:name].present?