mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 13:57:02 +08:00
feat(core): add no access to share menu (#10927)
This commit is contained in:
@@ -57,6 +57,7 @@ export const ExplorerDocNode = ({
|
||||
reference: isLinked,
|
||||
})
|
||||
);
|
||||
|
||||
const docTitle = useLiveData(docDisplayMetaService.title$(docId));
|
||||
const isInTrash = useLiveData(docRecord?.trash$);
|
||||
const enableEmojiIcon = useLiveData(
|
||||
@@ -133,10 +134,19 @@ export const ExplorerDocNode = ({
|
||||
operations={finalOperations}
|
||||
data-testid={`explorer-doc-${docId}`}
|
||||
>
|
||||
{children?.map(child => (
|
||||
<ExplorerDocNode key={child.docId} docId={child.docId} isLinked />
|
||||
))}
|
||||
|
||||
<DocPermissionGuard docId={docId} permission="Doc_Read">
|
||||
{canRead =>
|
||||
canRead
|
||||
? children?.map((child, index) => (
|
||||
<ExplorerDocNode
|
||||
key={`${child.docId}-${index}`}
|
||||
docId={child.docId}
|
||||
isLinked
|
||||
/>
|
||||
))
|
||||
: null
|
||||
}
|
||||
</DocPermissionGuard>
|
||||
<DocPermissionGuard docId={docId} permission="Doc_Update">
|
||||
{canEdit =>
|
||||
canEdit ? (
|
||||
|
||||
@@ -254,6 +254,9 @@ const MobileDetailPage = ({
|
||||
const [showTitle, setShowTitle] = useState(checkShowTitle);
|
||||
const title = useLiveData(docDisplayMetaService.title$(pageId));
|
||||
|
||||
const guardService = useService(GuardService);
|
||||
const canAccess = useLiveData(guardService.can$('Doc_Read', pageId));
|
||||
|
||||
const allJournalDates = useLiveData(journalService.allJournalDates$);
|
||||
|
||||
const location = useLiveData(workbench.location$);
|
||||
@@ -281,6 +284,7 @@ const MobileDetailPage = ({
|
||||
skeleton={date ? skeleton : skeletonWithBack}
|
||||
notFound={date ? notFound : notFoundWithBack}
|
||||
pageId={pageId}
|
||||
canAccess={canAccess}
|
||||
>
|
||||
<PageHeader
|
||||
back={!fromTab}
|
||||
|
||||
Reference in New Issue
Block a user