Merge pull request '新增 uuid' (#229) from KingChan/forgeplus:pm_project_develop into pm_project_develop

This commit is contained in:
KingChan
2023-11-21 17:11:51 +08:00
4 changed files with 60 additions and 44 deletions

View File

@@ -147,7 +147,7 @@ class AttachmentsController < ApplicationController
if params[:type] == 'history'
AttachmentHistory.find params[:id]
else
Attachment.find params[:id]
Attachment.find params[:id] || Attachment.find_by(uuid: params[:id])
end
end
@@ -218,7 +218,7 @@ class AttachmentsController < ApplicationController
def attachment_candown
unless current_user.admin? || current_user.business?
candown = true
if @file.container
if @file.container && @file.uuid.nil?
if @file.container.is_a?(Issue)
project = @file.container.project
candown = project.is_public || (current_user.logged? && project.member?(current_user))