From d18f291872561b00ea02daa0c0c22a032662f351 Mon Sep 17 00:00:00 2001 From: Benno Tielen Date: Tue, 21 Jul 2026 11:23:39 +0200 Subject: [PATCH] feature: auth --- src/collections/Announcements.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/collections/Announcements.ts b/src/collections/Announcements.ts index 7508860..1e357d5 100644 --- a/src/collections/Announcements.ts +++ b/src/collections/Announcements.ts @@ -1,6 +1,7 @@ import { CollectionConfig } from 'payload' -import { hide, isAdminOrEmployee } from '@/collections/access/admin' +import { hide } from '@/collections/access/admin' import { nextSunday } from '@/utils/sunday' +import { canCreateAssignedWorship, canMutateAssignedWorship } from '@/collections/access/assigned' export const Announcements: CollectionConfig = { slug: 'announcement', @@ -53,8 +54,8 @@ export const Announcements: CollectionConfig = { }, access: { read: () => true, - create: isAdminOrEmployee(), - update: isAdminOrEmployee(), - delete: isAdminOrEmployee(), + create: canCreateAssignedWorship(), + update: canMutateAssignedWorship(), + delete: canMutateAssignedWorship(), } } \ No newline at end of file