微信课件下载修改

weixin_guange
yuanke 9 years ago
parent 9997de0d96
commit 564da2ed72

@ -372,7 +372,8 @@ class ApplicationController < ActionController::Base
return true return true
end end
if allowed
if allowed || (params[:type] && params[:type] == "wechat" )
true true
else else
if @project && @project.archived? if @project && @project.archived?

@ -130,7 +130,7 @@ class AttachmentsController < ApplicationController
def download def download
# modify by nwb # modify by nwb
# 下载添加权限设置 # 下载添加权限设置
if params[:type] == "wechat" if (params[:type] && params[:type] == "wechat" )
candown = true candown = true
else else
candown = attachment_candown @attachment candown = attachment_candown @attachment
@ -715,7 +715,7 @@ class AttachmentsController < ApplicationController
def has_login def has_login
unless (@attachment && @attachment.container_type == "Organization").nil? unless (@attachment && @attachment.container_type == "Organization").nil?
unless (@attachment && @attachment.container_type == "PhoneAppVersion").nil? unless (@attachment && @attachment.container_type == "PhoneAppVersion").nil?
render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download) render_403 if (!User.current.logged? && !(params[:type] && params[:type] == "wechat")) && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download)
end end
end end
end end

Loading…
Cancel
Save