diff --git a/src/app/(payload)/access/isAdmin.ts b/src/app/(payload)/access/isAdmin.ts index 7a7020d..d649515 100644 --- a/src/app/(payload)/access/isAdmin.ts +++ b/src/app/(payload)/access/isAdmin.ts @@ -2,7 +2,6 @@ import { Access } from 'payload/types' import type { User } from 'types/payload-types' export const isAdmin = ({ req: { user } }: any) => { - return true if (!user.roles) { return false } @@ -15,7 +14,6 @@ export const isAdmin = ({ req: { user } }: any) => { } export const isAdminOrCreatedBy = ({ req: { user } }: any) => { - return true if (user.role) { return false } @@ -36,7 +34,6 @@ export const isAdminOrCreatedBy = ({ req: { user } }: any) => { } export const isAdminOrSelf = ({ req: { user } }: any) => { - return true if (user) { if (!user.roles) { return false @@ -57,7 +54,6 @@ export const isAdminOrSelf = ({ req: { user } }: any) => { } export const isAdminOrPublished = ({ req: { user } }: any) => { - return true if (user && user?.role === 'admin') { return true } diff --git a/src/app/(payload)/access/isEditor.ts b/src/app/(payload)/access/isEditor.ts index 50b4bfb..e25dbe5 100644 --- a/src/app/(payload)/access/isEditor.ts +++ b/src/app/(payload)/access/isEditor.ts @@ -2,7 +2,6 @@ import { Access, FieldAccess } from 'payload/types' import type { User } from 'types/payload-types' export const isEditor = ({ req: { user } }: any) => { - return true if (!user.roles) { return false } diff --git a/src/app/(payload)/access/isUser.ts b/src/app/(payload)/access/isUser.ts index fc5b6f9..5b9fdde 100644 --- a/src/app/(payload)/access/isUser.ts +++ b/src/app/(payload)/access/isUser.ts @@ -2,7 +2,6 @@ import { Access, FieldAccess } from 'payload/types' import type { User } from 'types/payload-types' export const isUser = ({ req: { user } }: any) => { - return true if (!user.roles) { return false }