This commit is contained in:
Tom Moor committed 2023-12-31 12:45:47 -05:00
1 parent ea3f0b12c8
commit 2e17d0c185
1 file changed
+7 -3
+7 -3
View File
@@ -149,12 +149,16 @@ allow(User, "share", Document, (user, document) => {
document.collection,
"collection is missing, did you forget to include in the query scope?"
);
if (can(user, "share", document.collection)) {
return true;
if (cannot(user, "share", document.collection)) {
return false;
}
}
return user.id === document.createdById;
if (document.isDraft) {
return user.id === document.createdById;
}
return user.teamId === document.teamId;
});
allow(User, "update", Document, (user, document) => {