Add accessDenied error (#5788)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2024-06-12 19:48:35 +07:00
committed by GitHub
parent fb7679ae5b
commit 8b87de46c8
14 changed files with 51 additions and 22 deletions
+7 -5
View File
@@ -14,20 +14,21 @@
//
import {
getCollaborativeDoc,
getCollaborativeDocId,
type AttachedData,
type Client,
type Ref,
type TxOperations,
getCollaborativeDoc,
getCollaborativeDocId
type TxOperations
} from '@hcengineering/core'
import { type Document, type Teamspace, documentId } from '@hcengineering/document'
import { documentId, type Document, type Teamspace } from '@hcengineering/document'
import { getMetadata, translate } from '@hcengineering/platform'
import presentation, { getClient } from '@hcengineering/presentation'
import { type Location, type ResolvedLocation, getCurrentResolvedLocation, getPanelURI } from '@hcengineering/ui'
import { getCurrentResolvedLocation, getPanelURI, type Location, type ResolvedLocation } from '@hcengineering/ui'
import { workbenchId } from '@hcengineering/workbench'
import slugify from 'slugify'
import { accessDeniedStore } from '@hcengineering/view-resources'
import document from './plugin'
export async function createEmptyDocument (
@@ -83,6 +84,7 @@ export async function generateLocation (loc: Location, id: Ref<Document>): Promi
const doc = await client.findOne(document.class.Document, { _id: id })
if (doc === undefined) {
accessDeniedStore.set(true)
console.error(`Could not find document ${id}.`)
return undefined
}