chore: Improve perf of server tests (#5785)
This commit is contained in:
@@ -98,13 +98,16 @@ allow(User, "share", Document, (user, document) => {
|
||||
if (document.deletedAt) {
|
||||
return false;
|
||||
}
|
||||
invariant(
|
||||
document.collection,
|
||||
"collection is missing, did you forget to include in the query scope?"
|
||||
);
|
||||
|
||||
if (cannot(user, "share", document.collection)) {
|
||||
return false;
|
||||
if (document.collectionId) {
|
||||
invariant(
|
||||
document.collection,
|
||||
"collection is missing, did you forget to include in the query scope?"
|
||||
);
|
||||
|
||||
if (cannot(user, "share", document.collection)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return user.teamId === document.teamId;
|
||||
|
||||
Reference in New Issue
Block a user