fix: Two restore options when an archived document is deleted (#2194)
* Merge two menu items * Add deletedAt guard condition in document unarchive policy * Make the parentDocumentId null * Update test
This commit is contained in:
@ -149,6 +149,7 @@ allow(User, "unarchive", Document, (user, document) => {
|
||||
if (cannot(user, "update", document.collection)) return false;
|
||||
|
||||
if (!document.archivedAt) return false;
|
||||
if (document.deletedAt) return false;
|
||||
|
||||
return user.teamId === document.teamId;
|
||||
});
|
||||
|
Reference in New Issue
Block a user