mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 06:43:06 +00:00
Editors publish post/tag/media without PII or campaign access; existing users backfill as admin.
33 lines
817 B
TypeScript
33 lines
817 B
TypeScript
import { canManagePublishedContent } from '@/utilities/campaignAccess'
|
|
import type { CollectionConfig } from 'payload'
|
|
|
|
export const Media: CollectionConfig = {
|
|
slug: 'media',
|
|
labels: {
|
|
singular: 'Mídia',
|
|
plural: 'Mídias',
|
|
},
|
|
admin: {
|
|
group: 'Coleções',
|
|
},
|
|
// Campaign flows (avatar, demand receipts) upload via server actions with an
|
|
// explicit overrideAccess: true after their own role checks.
|
|
access: {
|
|
read: () => true,
|
|
create: canManagePublishedContent,
|
|
update: canManagePublishedContent,
|
|
delete: canManagePublishedContent,
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'alt',
|
|
type: 'text',
|
|
label: 'Texto alternativo',
|
|
admin: {
|
|
description: 'Descrição da imagem para acessibilidade.',
|
|
},
|
|
required: true,
|
|
},
|
|
],
|
|
upload: true,
|
|
}
|