From ec8e609ddc8d7cd40abb11c169556431bf04b8ef Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Apr 2015 13:10:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E7=88=86=E4=B8=8B=E8=BD=BD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9D=83=E9=99=90=E3=80=81=E5=A2=9E=E5=8A=A0=E6=89=93?= =?UTF-8?q?=E5=8C=85=E4=B8=8B=E8=BD=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 2 ++ app/views/homework_attach/_homework.html.erb | 2 +- public/stylesheets/css.css | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index a3bee3c95..df354f107 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -16,9 +16,11 @@ class ZipdownController < ApplicationController end end + #一个作业下所有文件打包下载,只有admin和课程老师有权限 def assort if params[:obj_class] == "Bid" bid = Bid.find params[:obj_id] + render_403 if User.current.allowed_to?(:as_teacher,bid.courses.first) file_count = 0 bid.homeworks.map { |homework| file_count += homework.attachments.count} if file_count > 0 diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index 2b5c48cd4..fca25e8ee 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -26,7 +26,7 @@