generated from autonomic-cooperative/astro-payload-template
Add types dir to payload tsconfig
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
7dbc81c5b2
commit
cc0a5cb1c5
@ -1,5 +1,5 @@
|
|||||||
import { Access, FieldAccess } from "payload/types";
|
import { Access, FieldAccess } from "payload/types";
|
||||||
import { User } from "../payload-types";
|
import { User } from "@/types/payload-types";
|
||||||
|
|
||||||
export const isAdmin: Access<any, User> = ({ req: { user } }) => {
|
export const isAdmin: Access<any, User> = ({ req: { user } }) => {
|
||||||
// Return true or false based on if the user has an admin role
|
// Return true or false based on if the user has an admin role
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Access, FieldAccess } from "payload/types";
|
import { Access, FieldAccess } from "payload/types";
|
||||||
import { User } from "../payload-types";
|
import { User } from "@/types/payload-types";
|
||||||
|
|
||||||
export const isEditor: Access<any, User> = ({ req: { user } }) => {
|
export const isEditor: Access<any, User> = ({ req: { user } }) => {
|
||||||
// Return true or false based on if the user has an editor role
|
// Return true or false based on if the user has an editor role
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Access, FieldAccess } from "payload/types";
|
import { Access, FieldAccess } from "payload/types";
|
||||||
import { User } from "../payload-types";
|
import { User } from "@/types/payload-types";
|
||||||
|
|
||||||
export const isSSG: Access<any, User> = ({ req: { user } }) => {
|
export const isSSG: Access<any, User> = ({ req: { user } }) => {
|
||||||
// Return true or false based on if the user has an ssg or admin role
|
// Return true or false based on if the user has an ssg or admin role
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Access, FieldAccess } from "payload/types";
|
import { Access, FieldAccess } from "payload/types";
|
||||||
import { User } from "../payload-types";
|
import { User } from "@/types/payload-types";
|
||||||
|
|
||||||
export const isUser: Access<any, User> = ({ req: { user } }) => {
|
export const isUser: Access<any, User> = ({ req: { user } }) => {
|
||||||
// Return true or false based on if the user has an ssg or admin role
|
// Return true or false based on if the user has an ssg or admin role
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
import { Payload } from "payload";
|
import { Payload } from "payload";
|
||||||
import { User } from "./payload-types";
|
import { User } from "@/types/payload-types";
|
||||||
|
|
||||||
export const seed = async (payload: Payload): Promise<void> => {
|
export const seed = async (payload: Payload): Promise<void> => {
|
||||||
// Local API methods skip all access control by default
|
// Local API methods skip all access control by default
|
||||||
// so we can easily create an admin user directly in init
|
// so we can easily create an admin user directly in init
|
||||||
await payload.create<User>({
|
|
||||||
|
/* Disable to prevent mistakes */
|
||||||
|
/* await payload.create<User>({
|
||||||
collection: 'users',
|
collection: 'users',
|
||||||
data: {
|
data: {
|
||||||
email: 'astro@ssg.js',
|
email: 'astro@ssg.js',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
roles: ['ssg']
|
roles: ['ssg']
|
||||||
}
|
}
|
||||||
})
|
}) */
|
||||||
}
|
}
|
@ -7,7 +7,8 @@
|
|||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*", "./dist/*", "./dist/src/*"]
|
"@/*": ["./src/*", "./dist/*", "./dist/src/*"],
|
||||||
|
"@/types/*": ["../*"]
|
||||||
},
|
},
|
||||||
"jsx": "react"
|
"jsx": "react"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user