feat(auth): add users collection with role + displayName fields
This commit is contained in:
26
packages/auth/src/integrations/cms/collections/users.ts
Normal file
26
packages/auth/src/integrations/cms/collections/users.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import type { CollectionConfig } from "payload";
|
||||||
|
|
||||||
|
export const users: CollectionConfig = {
|
||||||
|
slug: "users",
|
||||||
|
auth: true,
|
||||||
|
admin: {
|
||||||
|
useAsTitle: "email",
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "displayName",
|
||||||
|
type: "text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "role",
|
||||||
|
type: "select",
|
||||||
|
options: [
|
||||||
|
{ label: "Admin", value: "admin" },
|
||||||
|
{ label: "Editor", value: "editor" },
|
||||||
|
{ label: "Author", value: "author" },
|
||||||
|
],
|
||||||
|
defaultValue: "author",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
1
packages/auth/src/integrations/cms/index.ts
Normal file
1
packages/auth/src/integrations/cms/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { users } from "./collections/users";
|
||||||
Reference in New Issue
Block a user