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 + + + +
+ + + + + + + + + +
+
+