There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
fix(core): workspace sharing settings should not be displayed when there is no permission (#8285)
JimmFlyaf5b9a3a2371
diff --git a/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/sharing.tsx b/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/sharing.tsxindex 7cd74250e1..614495a333 100644--- a/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/sharing.tsx+++ b/packages/frontend/core/src/components/affine/setting-modal/workspace-setting/new-workspace-setting-detail/sharing.tsx@@ -4,6 +4,7 @@ import {SettingWrapper,} from '@affine/component/setting-components';import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';+import { WorkspacePermissionService } from '@affine/core/modules/permissions';import { WorkspaceShareSettingService } from '@affine/core/modules/share-setting';import { WorkspaceFlavour } from '@affine/env/workspace';import { useI18n } from '@affine/i18n';@@ -22,6 +23,8 @@ export const Sharing = () => {const shareSetting = useService(WorkspaceShareSettingService).sharePreview;const enableUrlPreview = useLiveData(shareSetting.enableUrlPreview$);const loading = useLiveData(shareSetting.isLoading$);+ const permissionService = useService(WorkspacePermissionService);+ const isOwner = useLiveData(permissionService.permission.isOwner$);const handleCheck = useAsyncCallback(async (checked: boolean) => {@@ -30,6 +33,10 @@ export const Sharing = () => {[shareSetting]);+ if (!isOwner) {+ return null;+ }+return (<SettingWrapper title={t['com.affine.settings.workspace.sharing.title']()}><SettingRowdiff --git a/packages/frontend/i18n/src/resources/en.json b/packages/frontend/i18n/src/resources/en.jsonindex 2163763e1a..7adc1bd747 100644--- a/packages/frontend/i18n/src/resources/en.json+++ b/packages/frontend/i18n/src/resources/en.json@@ -1420,11 +1420,8 @@"com.affine.settings.workspace.publish-tooltip": "Enable AFFiNE Cloud to publish this workspace","com.affine.settings.workspace.sharing.title": "Sharing","com.affine.settings.workspace.sharing.url-preview.description": "Allow URL unfurling by Slack & other social apps, even if a doc is only accessible by workspace members.",- "com.affine.settings.workspace.sharing.url-preview.title": "Always Enable URL Preview",+ "com.affine.settings.workspace.sharing.url-preview.title": "Always enable url preview","com.affine.settings.workspace.storage.tip": "Click to move storage location.",- "com.affine.settings.workspace.sharing.title": "Sharing",- "com.affine.settings.workspace.sharing.url-preview.title": "Always Enable URL Preview",- "com.affine.settings.workspace.sharing.url-preview.description": "Allow URL unfurling by Slack & other social apps, even if a doc is only accessible by workspace members.","com.affine.share-menu.EnableCloudDescription": "Sharing doc requires AFFiNE Cloud.","com.affine.share-menu.ShareMode": "Share mode","com.affine.share-menu.SharePage": "Share doc",