mirror of
https://github.com/diced/zipline.git
synced 2025-12-05 20:40:12 -08:00
fix: editing files that are owned by the current user again
This commit is contained in:
@@ -148,7 +148,8 @@ export default fastifyPlugin(
|
|||||||
});
|
});
|
||||||
if (!file) return res.notFound();
|
if (!file) return res.notFound();
|
||||||
|
|
||||||
if (!canInteract(req.user.role, file.User?.role ?? 'USER')) return res.notFound();
|
if (req.user.id !== file.User?.id && !canInteract(req.user.role, file.User?.role ?? 'USER'))
|
||||||
|
return res.notFound();
|
||||||
|
|
||||||
const deletedFile = await prisma.file.delete({
|
const deletedFile = await prisma.file.delete({
|
||||||
where: {
|
where: {
|
||||||
|
|||||||
Reference in New Issue
Block a user