Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: allow members to delete documents

Marc Seitzf68afe011c84
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/documents/[documentId]/index.ts b/pages/api/teams/[teamId]/datarooms/[id]/documents/[documentId]/index.ts
index 81289402..385f013b 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/documents/[documentId]/index.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/documents/[documentId]/index.ts
@@ -101,13 +101,6 @@ export default async function handle(
return res.status(401).json({ message: "Unauthorized" });
}
- if (teamAccess.role !== "ADMIN" && teamAccess.role !== "MANAGER") {
- return res.status(403).json({
- message:
- "You are not permitted to perform this action. Only admin and managers can delete dataroom documents.",
- });
- }
-
const dataroom = await prisma.dataroom.findUnique({
where: {
id: dataroomId,
diff --git a/pages/api/teams/[teamId]/documents/[id]/index.ts b/pages/api/teams/[teamId]/documents/[id]/index.ts
index da9dcfb7..ad104041 100644
--- a/pages/api/teams/[teamId]/documents/[id]/index.ts
+++ b/pages/api/teams/[teamId]/documents/[id]/index.ts
@@ -279,13 +279,6 @@ export default async function handle(
return res.status(401).json({ message: "Unauthorized" });
}
- if (teamAccess.role !== "ADMIN" && teamAccess.role !== "MANAGER") {
- return res.status(403).json({
- message:
- "You are not permitted to perform this action. Only admin and managers can delete documents.",
- });
- }
-
const documentVersions = await prisma.document.findUnique({
where: {
id: docId,