UBERF-5275: Fix collaborator editing (#4505)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-02-03 00:16:40 +07:00 committed by GitHub
parent 752f8e68dd
commit 69ff8dd4c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 17 deletions

View File

@ -151,14 +151,14 @@ export async function start (
documentName = documentName.split('://', 2)[1]
}
if (documentName.includes('/')) {
const [workspace] = documentName.split('/', 2)
if (workspace !== context.workspaceId.name) {
throw new Error('documentName must include workspace')
}
} else {
throw new Error('documentName must include workspace')
}
// if (documentName.includes('/')) {
// const [workspace] = documentName.split('/', 2)
// if (workspace !== context.workspaceId.name) {
// throw new Error('documentName must include workspace')
// }
// } else {
// throw new Error('documentName must include workspace')
// }
return context
},

View File

@ -36,7 +36,7 @@ function parseDocumentId (documentId: string): MinioDocumentId {
}
function isValidDocumentId (documentId: MinioDocumentId, context: Context): boolean {
return documentId.minioDocumentId !== '' && documentId.workspace === context.workspaceId.name
return documentId.minioDocumentId !== '' // && documentId.workspace === context.workspaceId.name
}
function maybePlatformDocumentId (documentId: string): boolean {

View File

@ -41,10 +41,8 @@ function parseDocumentId (documentId: string): MongodbDocumentId {
function isValidDocumentId (documentId: MongodbDocumentId, context: Context): boolean {
return (
documentId.objectDomain !== '' &&
documentId.objectId !== '' &&
documentId.objectAttr !== '' &&
documentId.workspace === context.workspaceId.name
documentId.objectDomain !== '' && documentId.objectId !== '' && documentId.objectAttr !== ''
// && documentId.workspace === context.workspaceId.name
)
}

View File

@ -40,10 +40,8 @@ function parseDocumentId (documentId: string): PlatformDocumentId {
function isValidDocumentId (documentId: PlatformDocumentId, context: Context): boolean {
return (
documentId.objectClass !== '' &&
documentId.objectId !== '' &&
documentId.objectAttr !== '' &&
documentId.workspace === context.workspaceId.name
documentId.objectClass !== '' && documentId.objectId !== '' && documentId.objectAttr !== '' // &&
// documentId.workspace === context.workspaceId.name
)
}