From 3674e9b1cba7df77637db0ceed831a3f60b5d0f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:11:09 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20admin=E3=81=AE=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E4=B8=80=E8=A6=A7=E7=94=BB=E9=9D=A2=E3=81=A7?= =?UTF-8?q?=E3=80=81=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=8C=E6=B7=BB?= =?UTF-8?q?=E4=BB=98=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E3=83=8E?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=82=92=E4=B8=80=E8=A6=A7=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=20(#14403)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enhance(moderation): モデレーターがファイルが添付されているノートを照会できるように (MisskeyIO#680) Co-authored-by: riku6460 <17585784+riku6460@users.noreply.github.com> Co-authored-by: nenohi Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com> (cherry picked from commit b059162324d2cfc697d1af9f3b6fb49fad2734e0) * Update Changelog * :v: Co-authored-by: riku6460 <17585784+riku6460@users.noreply.github.com> Co-authored-by: nenohi Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com> --------- Co-authored-by: Yuuki Co-authored-by: riku6460 <17585784+riku6460@users.noreply.github.com> Co-authored-by: nenohi Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com> --- CHANGELOG.md | 2 ++ .../server/api/endpoints/drive/files/attached-notes.ts | 4 +++- packages/frontend/src/pages/admin-file.vue | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea78250e2..a211a96b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### General - Feat: UserWebhookとSystemWebhookのテスト送信機能を追加 (#14445) +- Feat: モデレーターはユーザーにかかわらずファイルが添付されているノートを検索できるように + (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/680) - Enhance: ユーザーによるコンテンツインポートの可否をロールポリシーで制御できるように ### Client diff --git a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts index 467039202..b86059b5e 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts @@ -10,6 +10,7 @@ import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; +import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['drive', 'notes'], @@ -61,12 +62,13 @@ export default class extends Endpoint { // eslint- private noteEntityService: NoteEntityService, private queryService: QueryService, + private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { // Fetch file const file = await this.driveFilesRepository.findOneBy({ id: ps.fileId, - userId: me.id, + userId: await this.roleService.isModerator(me) ? undefined : me.id, }); if (file == null) { diff --git a/packages/frontend/src/pages/admin-file.vue b/packages/frontend/src/pages/admin-file.vue index d8311186a..60f6be51d 100644 --- a/packages/frontend/src/pages/admin-file.vue +++ b/packages/frontend/src/pages/admin-file.vue @@ -44,6 +44,9 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.delete }} +
+ +
{{ i18n.ts.requireAdminForView }} @@ -67,7 +70,7 @@ SPDX-License-Identifier: AGPL-3.0-only