🔀 Merge remote-tracking branch 'origin/main' into release/v1.0.6

This commit is contained in:
Eric Doughty-Papassideris
2025-01-27 18:28:28 +01:00
4 changed files with 30 additions and 3 deletions
@@ -419,9 +419,9 @@ export const getItemScope = async (
context: CompanyExecutionContext,
): Promise<"personal" | "shared"> => {
let scope: "personal" | "shared";
if (item.parent_id.startsWith("user_")) {
if (item.parent_id.startsWith("user_") || item.parent_id.startsWith("trash_")) {
scope = "personal";
} else if (item.parent_id === "root") {
} else if (item.parent_id === "root" || item.parent_id === "trash") {
scope = "shared";
} else {
const driveItemParent = await repository.findOne(
@@ -821,7 +821,8 @@ export class DocumentsService {
// Check item belongs to someone
if (item.creator !== context?.user?.id) {
const creator = await this.userRepository.findOne({ id: item.creator });
if (creator.type === "anonymous") {
//if the file was created by an application or anonymous user
if (creator == null || creator.type === "anonymous") {
const loadedCreators = new Map<string, User>();
let firstOwnedItem: DriveFile | undefined;
for (let i = path.length - 1; i >= 0; i--) {