chore: change the way that share permissions are checked on child documents to use the parentId field of documents rather than the collection structure (#3294)
This commit is contained in:
@@ -542,10 +542,12 @@ async function loadDocument({
|
||||
// shared then includeChildDocuments must be enabled and the document must
|
||||
// still be nested within the shared document
|
||||
if (share.document.id !== document.id) {
|
||||
if (
|
||||
!share.includeChildDocuments ||
|
||||
!collection.isChildDocument(share.document.id, document.id)
|
||||
) {
|
||||
if (!share.includeChildDocuments) {
|
||||
throw AuthorizationError();
|
||||
}
|
||||
|
||||
const childDocumentIds = await share.document.getChildDocumentIds();
|
||||
if (!childDocumentIds.includes(document.id)) {
|
||||
throw AuthorizationError();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user