Add missing type declaration for isEditor
This commit is contained in:
parent
e63dd42b6c
commit
d77c33f548
@ -2,7 +2,7 @@ import { Access, FieldAccess } from 'payload/types'
|
|||||||
import type { User } from 'types/payload-types'
|
import type { User } from 'types/payload-types'
|
||||||
|
|
||||||
export const isEditor = ({ req: { user } }: any) => {
|
export const isEditor = ({ req: { user } }: any) => {
|
||||||
if (user?.roles?.some((role) => ['editor', 'admin'].includes(role))) {
|
if (user && user?.roles?.some((role: string) => ['editor', 'admin'].includes(role))) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user