change: layout and make responsive
This commit is contained in:
@@ -11,9 +11,10 @@ export const Papers: CollectionConfig = {
|
||||
delete: ({ req: { user } }) => Boolean(user?.type === "admin"),
|
||||
read: () => true,
|
||||
update: async ({ req: { user, payload }, id }) => {
|
||||
if (!user || !id) return false; // Explicitly handle missing ID
|
||||
|
||||
if (user?.type === "admin") return true;
|
||||
|
||||
if (!user || !id) return false; // Explicitly handle missing ID
|
||||
|
||||
const paper = await payload.findByID({
|
||||
collection: "papers",
|
||||
@@ -22,6 +23,7 @@ export const Papers: CollectionConfig = {
|
||||
});
|
||||
|
||||
if (!paper) return false;
|
||||
if(paper.published) return false;
|
||||
|
||||
return paper.authors.some((author: any) => author.name === user.name);
|
||||
},
|
||||
@@ -34,7 +36,7 @@ export const Papers: CollectionConfig = {
|
||||
name: "published",
|
||||
type: "checkbox",
|
||||
defaultValue: false,
|
||||
label: "Veröffentlicht",
|
||||
label: "Veröffentlicht (Auf der Website sichtbar)",
|
||||
access: {
|
||||
update: ({ req: { user } }) => Boolean(user?.type === "admin"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user