From e9b682383b9b44805301edd4ea3ec417f8ba8455 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 19 Aug 2019 10:47:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 3d6e20ee9..df74cf737 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -172,10 +172,7 @@ class AttachmentsController < ApplicationController # 课堂资源、作业、毕设相关资源的权限判断 if @file.container.is_a?(Course) course = @file.container - Rails.logger.info("@@@@@@@@@@@@######################## course_id#{course.id}") - candown = current_user.member_of_course?(course) || @file.is_public == 1 - Rails.logger.info("@@@@@@@@@@@@######################## public #{@file.is_public}") - Rails.logger.info("@@@@@@@@@@@@#########################{candown}") + candown = current_user.member_of_course?(course) || (course.is_public? && @file.publiced?) elsif @file.container.is_a?(HomeworkCommon) || @file.container.is_a?(GraduationTask) || @file.container.is_a?(GraduationTopic) course = @file.container&.course candown = current_user.member_of_course?(course)