From 735d7f2c1fd3bcc80e6da600809c2f47090e272f Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 25 Jul 2014 14:05:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8B=E8=BD=BD=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=88=A4=E6=96=AD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index a0da2d025..182a37453 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -54,13 +54,13 @@ class AttachmentsController < ApplicationController # modify by nwb # 下载添加权限设置 candown = false - if @attachment.container.has_attribute?(:project) && @attachment.container.project + if (@attachment.container.has_attribute?(:project) || @attachment.container.has_attribute?(:project_id)) && @attachment.container.project project = @attachment.container.project candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) elsif @attachment.container.is_a?(Project) project = @attachment.container candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) - elsif @attachment.container.has_attribute?(:course) && @attachment.container.course + elsif (@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course course = @attachment.container.course candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1) elsif @attachment.container.is_a?(Course)