🐛 Added necessary log for access check

This commit is contained in:
Montassar Ghanmy
2023-10-23 12:47:17 +00:00
committed by GitHub
parent 09ece3101e
commit 78d35a632d
@@ -215,7 +215,7 @@ export const getAccessLevel = async (
}
if (!item) {
throw Error("Drive item doesn't exist");
throw Error(`Drive item doesn't exist ${id}`);
}
if (item.scope === "personal" && item.creator == context.user.id) return "manage";
@@ -238,7 +238,7 @@ export const getAccessLevel = async (
}
if (!item) {
throw Error("Drive item doesn't exist");
throw Error(`Drive item doesn't exist ${id}`);
}
/*
@@ -312,6 +312,7 @@ export const getAccessLevel = async (
"none",
) as DriveFileAccessLevel | "none";
} catch (error) {
logger.warn(`Failed to check access for ${id}, ${JSON.stringify(context)}`);
throw Error(error);
}
};