From 2ebd426ee9bbe4fea31f7a542a4744f2a7e8a968 Mon Sep 17 00:00:00 2001 From: lego-eden Date: Tue, 26 Nov 2024 19:12:43 +0100 Subject: [PATCH] allow people with the write access policy to delete governing documents --- src/database/prisma/schema.prisma | 1 + src/database/schema.zmodel | 1 + 2 files changed, 2 insertions(+) diff --git a/src/database/prisma/schema.prisma b/src/database/prisma/schema.prisma index f07e5bd8a..6ede471c4 100644 --- a/src/database/prisma/schema.prisma +++ b/src/database/prisma/schema.prisma @@ -455,6 +455,7 @@ model ExpoToken { /// @@allow('create', has(auth().policies, 'governing_document:write')) /// @@allow('read', has(auth().policies, 'governing_document:read')) +/// @@allow('delete', has(auth().policies, 'governing_document:write')) /// @@deny('read', deletedAt != null) /// @@allow('update', has(auth().policies, 'governing_document:write')) /// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments diff --git a/src/database/schema.zmodel b/src/database/schema.zmodel index 9f53ed5ea..71dace9d2 100644 --- a/src/database/schema.zmodel +++ b/src/database/schema.zmodel @@ -461,6 +461,7 @@ model Document { @@allow("create", has(auth().policies, "governing_document:write")) @@allow("read", has(auth().policies, "governing_document:read")) + @@allow("delete", has(auth().policies, "governing_document:write")) @@deny("read", deletedAt != null) @@allow("update", has(auth().policies, "governing_document:write")) @@map("documents")