From 90e8b942a3f87b4c8f585c38b0f31e863ab6fa99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Wed, 27 Dec 2023 10:16:48 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B5=E3=82=A6=E3=83=B3=E3=83=89=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=81=A7=E3=83=89=E3=83=A9=E3=82=A4=E3=83=96=E3=81=AE?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E5=88=A9=E7=94=A8?= =?UTF-8?q?=E5=8F=AF=E5=90=A6=E3=82=92=E3=83=AD=E3=83=BC=E3=83=AB=E3=81=A7?= =?UTF-8?q?=E5=88=B6=E5=BE=A1=E5=8F=AF=E8=83=BD=E3=81=AB(=E3=83=87?= =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88=E3=81=A7=E3=82=AA=E3=83=95?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en-US.yml | 3 ++- locales/index.d.ts | 1 + locales/ja-JP.yml | 1 + locales/ko-KR.yml | 1 + packages/backend/src/core/RoleService.ts | 3 +++ .../backend/src/models/json-schema/role.ts | 1 + .../backend/src/models/json-schema/user.ts | 4 ++++ packages/frontend/src/const.ts | 1 + .../frontend/src/pages/admin/roles.editor.vue | 20 +++++++++++++++++++ packages/frontend/src/pages/admin/roles.vue | 10 +++++++++- packages/frontend/src/scripts/sound.ts | 5 +++-- packages/misskey-js/src/autogen/types.ts | 8 +++++++- 12 files changed, 53 insertions(+), 5 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 0c8c0e566..bb39dbfbe 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1603,7 +1603,8 @@ _role: descriptionOfRateLimitFactor: "Lower rate limits are less restrictive, higher ones more restrictive. " canHideAds: "Can hide ads" canSearchNotes: "Usage of note search" - canUseTranslator: "Translator usage" + canUseTranslator: "Can use Translator" + canUseDriveFileInSoundSettings: "Can use Drive File in Sound Settings" _condition: isLocal: "Local user" isRemote: "Remote user" diff --git a/locales/index.d.ts b/locales/index.d.ts index 2e2ade882..91e0f0250 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1719,6 +1719,7 @@ export interface Locale { "canHideAds": string; "canSearchNotes": string; "canUseTranslator": string; + "canUseDriveFileInSoundSettings": string; "avatarDecorationLimit": string; }; "_condition": { diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 71fad097d..eb13e4be1 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1628,6 +1628,7 @@ _role: canHideAds: "広告の非表示" canSearchNotes: "ノート検索の利用" canUseTranslator: "翻訳機能の利用" + canUseDriveFileInSoundSettings: "サウンド設定でドライブのファイルを利用" avatarDecorationLimit: "アイコンデコレーションの最大取付個数" _condition: isLocal: "ローカルユーザー" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index bc8e52ff6..d1fe4ab82 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -1612,6 +1612,7 @@ _role: canHideAds: "광고 숨기기" canSearchNotes: "노트 검색 이용 가능 여부" canUseTranslator: "번역 기능의 사용" + canUseDriveFileInSoundSettings: "사운드 설정에서 드라이브의 파일 사용 가능 여부" avatarDecorationLimit: "아바타 장식의 최대 붙임 개수" _condition: isLocal: "로컬 사용자" diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index 0ea7b03a5..136dfdcfa 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -47,6 +47,7 @@ export type RolePolicies = { canManageAvatarDecorations: boolean; canSearchNotes: boolean; canUseTranslator: boolean; + canUseDriveFileInSoundSettings: boolean; canHideAds: boolean; driveCapacityMb: number; alwaysMarkNsfw: boolean; @@ -77,6 +78,7 @@ export const DEFAULT_POLICIES: RolePolicies = { canManageAvatarDecorations: false, canSearchNotes: false, canUseTranslator: true, + canUseDriveFileInSoundSettings: false, canHideAds: false, driveCapacityMb: 100, alwaysMarkNsfw: false, @@ -341,6 +343,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { canManageAvatarDecorations: calc('canManageAvatarDecorations', vs => vs.some(v => v === true)), canSearchNotes: calc('canSearchNotes', vs => vs.some(v => v === true)), canUseTranslator: calc('canUseTranslator', vs => vs.some(v => v === true)), + canUseDriveFileInSoundSettings: calc('canUseDriveFileInSoundSettings', vs => vs.some(v => v === true)), canHideAds: calc('canHideAds', vs => vs.some(v => v === true)), driveCapacityMb: calc('driveCapacityMb', vs => Math.max(...vs)), alwaysMarkNsfw: calc('alwaysMarkNsfw', vs => vs.some(v => v === true)), diff --git a/packages/backend/src/models/json-schema/role.ts b/packages/backend/src/models/json-schema/role.ts index b0c6804bb..b6be0eedf 100644 --- a/packages/backend/src/models/json-schema/role.ts +++ b/packages/backend/src/models/json-schema/role.ts @@ -144,6 +144,7 @@ export const packedRoleSchema = { canManageCustomEmojis: rolePolicyValue, userEachUserListsLimit: rolePolicyValue, canManageAvatarDecorations: rolePolicyValue, + canUseDriveFileInSoundSettings: rolePolicyValue, canUseTranslator: rolePolicyValue, avatarDecorationLimit: rolePolicyValue, }, diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index 24c3335d4..dc94b0339 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -627,6 +627,10 @@ export const packedMeDetailedOnlySchema = { type: 'boolean', nullable: false, optional: false, }, + canUseDriveFileInSoundSettings: { + type: 'boolean', + nullable: false, optional: false, + }, canHideAds: { type: 'boolean', nullable: false, optional: false, diff --git a/packages/frontend/src/const.ts b/packages/frontend/src/const.ts index 1d9a08472..6e11987e7 100644 --- a/packages/frontend/src/const.ts +++ b/packages/frontend/src/const.ts @@ -86,6 +86,7 @@ export const ROLE_POLICIES = [ 'canManageAvatarDecorations', 'canSearchNotes', 'canUseTranslator', + 'canUseDriveFileInSoundSettings', 'canHideAds', 'driveCapacityMb', 'alwaysMarkNsfw', diff --git a/packages/frontend/src/pages/admin/roles.editor.vue b/packages/frontend/src/pages/admin/roles.editor.vue index 663ec0d80..cd8a492f6 100644 --- a/packages/frontend/src/pages/admin/roles.editor.vue +++ b/packages/frontend/src/pages/admin/roles.editor.vue @@ -379,6 +379,26 @@ SPDX-License-Identifier: AGPL-3.0-only + + + +
+ + + + + + + + + +
+
+