Skip to content

Commit 2bd8f93

Browse files
liaobwRock-520
authored andcommitted
修复附件归属的问题
1 parent dce2482 commit 2bd8f93

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/super-magic-module/src/Application/SuperAgent/Service/WorkspaceAppService.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,13 @@ public function getFileUrls(MagicUserAuthorization $userAuthorization, array $fi
541541
continue;
542542
}
543543

544+
// 验证文件是否属于当前用户
545+
$topicEntity = $this->workspaceDomainService->getTopicById($fileEntity->getTopicId());
546+
if (empty($topicEntity) || $topicEntity->getUserId() !== $userAuthorization->getId()) {
547+
// 如果这个话题不是本人的,不处理
548+
continue;
549+
}
550+
544551
$downloadNames = [];
545552
if ($downloadMode == 'download') {
546553
$downloadNames[$fileEntity->getFileKey()] = $fileEntity->getFileName();

0 commit comments

Comments
 (0)