fix: Shared documents on suspended teams should be hidden

This commit is contained in:
Tom Moor
2024-03-18 23:10:58 -04:00
parent be211dbc5c
commit 5248c95211

View File

@@ -186,6 +186,9 @@ export default async function loadDocument({
// It is possible to disable sharing at the team level so we must check
const team = await Team.findByPk(document.teamId, { rejectOnEmpty: true });
if (team.suspendedAt) {
throw NotFoundError();
}
if (!team.sharing) {
throw AuthorizationError();
}