add: working JSON data insert
This commit is contained in:
@@ -9,6 +9,7 @@ export const Papers: CollectionConfig = {
|
||||
access: {
|
||||
create: ({ req: { user } }) => Boolean(user?.type === "admin"),
|
||||
delete: ({ req: { user } }) => Boolean(user?.type === "admin"),
|
||||
read: () => true,
|
||||
update: async ({ req: { user, payload }, id }) => {
|
||||
if (user?.type === "admin") return true;
|
||||
|
||||
@@ -22,7 +23,7 @@ export const Papers: CollectionConfig = {
|
||||
|
||||
if (!paper) return false;
|
||||
|
||||
return paper.authors.some((author: any) => author.user.name === user.name);
|
||||
return paper.authors.some((author: any) => author.name === user.name);
|
||||
},
|
||||
},
|
||||
admin: {
|
||||
|
||||
Reference in New Issue
Block a user