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