fix: Moving document in private collection returns incorrect policies (#1969)
* fix: Return no policies when collection doesn't change fix: Return correct policies when it does change * test
This commit is contained in:
@ -1047,7 +1047,7 @@ router.post("documents.move", auth(), async (ctx) => {
|
||||
authorize(user, "update", parent);
|
||||
}
|
||||
|
||||
const { documents, collections } = await documentMover({
|
||||
const { documents, collections, collectionChanged } = await documentMover({
|
||||
user,
|
||||
document,
|
||||
collectionId,
|
||||
@ -1065,7 +1065,7 @@ router.post("documents.move", auth(), async (ctx) => {
|
||||
collections.map((collection) => presentCollection(collection))
|
||||
),
|
||||
},
|
||||
policies: presentPolicies(user, documents),
|
||||
policies: collectionChanged ? presentPolicies(user, documents) : [],
|
||||
};
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user