diff --git a/packages/account-client/src/client.ts b/packages/account-client/src/client.ts index 09336dd1e7..97f5429004 100644 --- a/packages/account-client/src/client.ts +++ b/packages/account-client/src/client.ts @@ -117,6 +117,7 @@ export interface AccountClient { updateAllowReadOnlyGuests: ( readOnlyGuestsAllowed: boolean ) => Promise<{ guestPerson: Person, guestSocialIds: SocialId[] } | undefined> + updateAllowGuestSignUp: (guestSignUpAllowed: boolean) => Promise updateWorkspaceName: (name: string) => Promise deleteWorkspace: () => Promise findPersonBySocialKey: (socialKey: string, requireAccount?: boolean) => Promise @@ -659,6 +660,15 @@ class AccountClientImpl implements AccountClient { return await this.rpc(request) } + async updateAllowGuestSignUp (guestSignUpAllowed: boolean): Promise { + const request = { + method: 'updateAllowGuestSignUp' as const, + params: { guestSignUpAllowed } + } + + await this.rpc(request) + } + async getWorkspaceMembers (): Promise { const request = { method: 'getWorkspaceMembers' as const, diff --git a/packages/account-client/src/types.ts b/packages/account-client/src/types.ts index 95c9cf8df6..33dee51422 100644 --- a/packages/account-client/src/types.ts +++ b/packages/account-client/src/types.ts @@ -57,6 +57,7 @@ export interface WorkspaceLoginInfo extends LoginInfo { endpoint: string token: string role: AccountRole + allowGuestSignUp?: boolean } export interface WorkspaceInviteInfo { @@ -122,5 +123,5 @@ export interface AccountAggregatedInfo extends AccountInfo, Person { uuid: AccountUuid integrations: Omit[] socialIds: SocialId[] - workspaces: Omit[] + workspaces: Omit[] } diff --git a/packages/core/src/classes.ts b/packages/core/src/classes.ts index de03fbdf76..a68cba0c57 100644 --- a/packages/core/src/classes.ts +++ b/packages/core/src/classes.ts @@ -832,6 +832,7 @@ export interface WorkspaceInfo { createdBy?: PersonUuid // Should always be set for NEW workspaces billingAccount?: PersonUuid // Should always be set for NEW workspaces allowReadOnlyGuest?: boolean // Should always be set for NEW workspaces + allowGuestSignUp?: boolean // Should always be set for NEW workspaces } export interface BackupStatus { diff --git a/plugins/setting-assets/lang/cs.json b/plugins/setting-assets/lang/cs.json index e4d1211a7d..1dfe124a97 100644 --- a/plugins/setting-assets/lang/cs.json +++ b/plugins/setting-assets/lang/cs.json @@ -169,6 +169,7 @@ "Customize": "Přizpůsobit", "GuestAccess": "Anonymní hosté", "GuestAccessDescription": "Umožňuje anonymním uživatelům prohlížet pracovní prostor v režimu pouze pro čtení", + "GuestSignUpDescription": "Umožňuje anonymním uživatelům připojit se k vašemu pracovnímu prostoru jako hosté s omezenými editačními právy", "ManageIdentities": "Spravovat identity", "Release": "Uvolnění", "ReleaseSocialId": "Uvolnit sociální ID", diff --git a/plugins/setting-assets/lang/de.json b/plugins/setting-assets/lang/de.json index 415059d7b5..94e3da0a88 100644 --- a/plugins/setting-assets/lang/de.json +++ b/plugins/setting-assets/lang/de.json @@ -169,6 +169,7 @@ "Customize": "Anpassen", "GuestAccess": "Anonyme Gäste", "GuestAccessDescription": "Ermöglicht anonymen Benutzern den schreibgeschützten Zugriff auf den Arbeitsbereich", + "GuestSignUpDescription": "Ermöglicht anonymen Benutzern den Beitritt zu Ihrem Arbeitsbereich als Gäste mit eingeschränkten Bearbeitungsrechten", "ManageIdentities": "Identitäten verwalten", "Release": "Freigeben", "ReleaseSocialId": "Social ID freigeben", diff --git a/plugins/setting-assets/lang/en.json b/plugins/setting-assets/lang/en.json index cc5719c130..8627ee8352 100644 --- a/plugins/setting-assets/lang/en.json +++ b/plugins/setting-assets/lang/en.json @@ -169,6 +169,7 @@ "Customize": "Customize", "GuestAccess": "Anonymous guests", "GuestAccessDescription": "Allows anonymous users to visit your workspace in read-only mode", + "GuestSignUpDescription": "Allows anonymous users to join your workspace as guests with limited editing rights", "ManageIdentities": "Manage identities", "Release": "Release", "ReleaseSocialId": "Release social ID", diff --git a/plugins/setting-assets/lang/es.json b/plugins/setting-assets/lang/es.json index 2ffb2dc10f..04f9e2b054 100644 --- a/plugins/setting-assets/lang/es.json +++ b/plugins/setting-assets/lang/es.json @@ -160,6 +160,7 @@ "Customize": "Personalizar", "GuestAccess": "Invitados anónimos", "GuestAccessDescription": "Permite a usuarios anónimos visitar el espacio de trabajo en modo de solo lectura", + "GuestSignUpDescription": "Permite a usuarios anónimos unirse a su espacio de trabajo como invitados con derechos de edición limitados", "ManageIdentities": "Gestionar identidades", "Release": "Liberar", "ReleaseSocialId": "Liberar ID social", diff --git a/plugins/setting-assets/lang/fr.json b/plugins/setting-assets/lang/fr.json index 70c8e437a9..fd291d4d25 100644 --- a/plugins/setting-assets/lang/fr.json +++ b/plugins/setting-assets/lang/fr.json @@ -169,6 +169,7 @@ "Customize": "Personnaliser", "GuestAccess": "Invités anonymes", "GuestAccessDescription": "Autorise les utilisateurs anonymes à accéder à l'espace de travail en lecture seule", + "GuestSignUpDescription": "Permet aux utilisateurs anonymes de rejoindre votre espace de travail en tant qu'invités avec des droits d'édition limités", "ManageIdentities": "Gérer les identités", "Release": "Libération", "ReleaseSocialId": "Libérer l'ID social", diff --git a/plugins/setting-assets/lang/it.json b/plugins/setting-assets/lang/it.json index 2d170de1f8..153ce0035f 100644 --- a/plugins/setting-assets/lang/it.json +++ b/plugins/setting-assets/lang/it.json @@ -169,6 +169,7 @@ "Customize": "Personalizzare", "GuestAccess": "Ospiti anonimi", "GuestAccessDescription": "Consente agli utenti anonimi di accedere all'area di lavoro in modalità sola lettura", + "GuestSignUpDescription": "Consente agli utenti anonimi di unirsi al tuo spazio di lavoro come ospiti con diritti di modifica limitati", "ManageIdentities": "Gestisci identità", "Release": "Rilascio", "ReleaseSocialId": "Rilascia ID social", diff --git a/plugins/setting-assets/lang/ja.json b/plugins/setting-assets/lang/ja.json index 60dc459a7a..810823bde1 100644 --- a/plugins/setting-assets/lang/ja.json +++ b/plugins/setting-assets/lang/ja.json @@ -169,6 +169,7 @@ "Customize": "カスタマイズ", "GuestAccess": "匿名ゲスト", "GuestAccessDescription": "匿名ユーザーがワークスペースを読み取り専用モードで閲覧できます", + "GuestSignUpDescription": "匿名ユーザーがゲストとしてワークスペースに参加し、制限された編集権限を得られるようにします", "ManageIdentities": "IDを管理", "Release": "リリース", "ReleaseSocialId": "ソーシャルIDをリリース", diff --git a/plugins/setting-assets/lang/pt.json b/plugins/setting-assets/lang/pt.json index a273e350b8..2f46c0d760 100644 --- a/plugins/setting-assets/lang/pt.json +++ b/plugins/setting-assets/lang/pt.json @@ -160,6 +160,7 @@ "Customize": "Personalizar", "GuestAccess": "Convidados anônimos", "GuestAccessDescription": "Permite que usuários anônimos acessem seu espaço de trabalho em modo somente leitura", + "GuestSignUpDescription": "Permite que usuários anônimos entrem em seu espaço de trabalho como convidados com direitos de edição limitados", "ManageIdentities": "Gerenciar identidades", "Release": "Libertação", "ReleaseSocialId": "Liberar ID social", diff --git a/plugins/setting-assets/lang/ru.json b/plugins/setting-assets/lang/ru.json index 64ff6ea1fb..db1ec53883 100644 --- a/plugins/setting-assets/lang/ru.json +++ b/plugins/setting-assets/lang/ru.json @@ -169,6 +169,7 @@ "Customize": "Настроить", "GuestAccess": "Анонимные гости", "GuestAccessDescription": "Позволяет анонимным пользователям просматривать рабочее пространство в режиме только для чтения", + "GuestSignUpDescription": "Позволяет анонимным пользователям присоединяться к вашему рабочему пространству в качестве гостей с ограниченными правами редактирования", "ManageIdentities": "Управление идентификаторами", "Release": "Освободить", "ReleaseSocialId": "Освободить социальный ID", diff --git a/plugins/setting-assets/lang/zh.json b/plugins/setting-assets/lang/zh.json index 5e0ffe76cb..25b7b1189f 100644 --- a/plugins/setting-assets/lang/zh.json +++ b/plugins/setting-assets/lang/zh.json @@ -169,6 +169,7 @@ "Customize": "自定义", "GuestAccess": "匿名访客", "GuestAccessDescription": "允许匿名用户以只读模式访问工作区", + "GuestSignUpDescription": "允许匿名用户以访客身份加入您的工作区,获得有限的编辑权限", "ManageIdentities": "管理身份", "Release": "释放", "ReleaseSocialId": "释放社交ID", diff --git a/plugins/setting-resources/src/components/General.svelte b/plugins/setting-resources/src/components/General.svelte index e9ba78fb84..03216468cb 100644 --- a/plugins/setting-resources/src/components/General.svelte +++ b/plugins/setting-resources/src/components/General.svelte @@ -58,6 +58,7 @@ let oldName: string let name: string = '' let allowReadOnlyGuests: boolean + let allowGuestSignUp: boolean const accountClient = getAccountClient() const disabledSet = ['\n', '<', '>', '/', '\\'] @@ -77,6 +78,7 @@ oldName = res.name name = oldName allowReadOnlyGuests = res.allowReadOnlyGuest ?? false + allowGuestSignUp = res.allowGuestSignUp ?? false loading = false } @@ -155,6 +157,7 @@ async function handleToggleReadonlyAccess (e: CustomEvent): Promise { const enabled = e.detail const guestUserInfo = await accountClient.updateAllowReadOnlyGuests(enabled) + allowReadOnlyGuests = enabled if (guestUserInfo !== undefined) { const guestAccount: Account = { uuid: guestUserInfo.guestPerson.uuid as AccountUuid, @@ -181,6 +184,10 @@ } } + async function handleToggleGuestSignUp (e: CustomEvent): Promise { + await accountClient.updateAllowGuestSignUp(e.detail) + } + function handleTogglePermissions (): void { const newState = !arePermissionsDisabled showPopup(MessageBox, { @@ -223,6 +230,7 @@ selected = items[savedFirstDayOfWeek === 'system' ? 0 : $deviceInfo.firstDayOfWeek + 1].id } ) + const onSelected = (e: CustomEvent): void => { selected = e.detail localStorage.setItem('firstDayOfWeek', `${e.detail}`) @@ -302,6 +310,16 @@ }} /> +
+