Skip to content

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

Merge branch 'main' into 288/permissionSetting

Ashish Viradiya001b76dd36f1
diff --cc prisma/schema/dataroom.prisma
index 0cd8d3e4,ab41cd1e..a5633da8
--- a/prisma/schema/dataroom.prisma
+++ b/prisma/schema/dataroom.prisma
@@@ -158,9 -153,43 +160,50 @@@ enum ItemType
DATAROOM_FOLDER
}
+enum DefaultGroupPermissionStrategy {
+ ask_every_time
+ inherit_from_parent
+ use_default_permissions
+ no_permissions
++}
++
+ model PermissionGroup {
+ id String @id @default(cuid())
+ name String
+ description String?
+
+ links Link[]
+ accessControls PermissionGroupAccessControls[]
+
+ dataroomId String
+ dataroom Dataroom @relation(fields: [dataroomId], references: [id], onDelete: Cascade)
+ teamId String
+ team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
+
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+
+ @@index([dataroomId])
+ @@index([teamId])
+ }
+
+ model PermissionGroupAccessControls {
+ id String @id @default(cuid())
+ groupId String
+ group PermissionGroup @relation(fields: [groupId], references: [id], onDelete: Cascade)
+
+ // Access control for items (documents or dataroom items)
+ itemId String // This can be a document ID or a dataroom item ID
+ itemType ItemType // Enum: DATAROOM_DOCUMENT, DATAROOM_FOLDER
+
+ // Granular permissions
+ canView Boolean @default(true)
+ canDownload Boolean @default(false)
+ canDownloadOriginal Boolean @default(false)
+
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+
+ @@unique([groupId, itemId])
+ @@index([groupId])
}