generated from autonomic-cooperative/astro-payload-template
Collection access tweaks
This commit is contained in:
parent
691729c53c
commit
b91dd893a4
@ -1,3 +1,4 @@
|
||||
import { isUser } from "@/access/isUser";
|
||||
import { CollectionConfig } from "payload/types";
|
||||
|
||||
export const Media: CollectionConfig = {
|
||||
@ -5,15 +6,15 @@ export const Media: CollectionConfig = {
|
||||
admin: {},
|
||||
access: {
|
||||
read: (): boolean => true,
|
||||
create: () => true,
|
||||
update: () => true,
|
||||
create: isUser,
|
||||
update: isUser,
|
||||
delete: isUser,
|
||||
},
|
||||
upload: {
|
||||
staticURL: "/media",
|
||||
staticDir: "media",
|
||||
mimeTypes: ["image/*"],
|
||||
},
|
||||
|
||||
fields: [
|
||||
{
|
||||
name: "alt",
|
||||
|
@ -6,6 +6,7 @@ const Users: CollectionConfig = {
|
||||
slug: 'users',
|
||||
auth: true,
|
||||
admin: {
|
||||
defaultColumns: ["roles", "email"],
|
||||
useAsTitle: 'email',
|
||||
},
|
||||
access: {
|
||||
@ -22,7 +23,7 @@ const Users: CollectionConfig = {
|
||||
{ label: 'ssg', value: 'ssg' }, //cRud
|
||||
{ label: 'Admin', value: 'admin' }, //CRUD, role creation
|
||||
{ label: 'Editor', value: 'editor' }, //CRUD
|
||||
{ label: 'User', value: 'user' }, //CRUd
|
||||
{ label: 'User', value: 'user' }, //cRud, CRUD own entries
|
||||
],
|
||||
required: true,
|
||||
defaultValue: "user",
|
||||
|
Loading…
Reference in New Issue
Block a user