From 65c524251d49ade9d44a62337f3c1c1fed6eedd0 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Wed, 28 Mar 2018 15:22:34 -0400 Subject: Permissions --- backend/database/datamodel.graphql | 21 ++++++++++----------- backend/database/prisma.yml | 3 ++- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'backend/database') diff --git a/backend/database/datamodel.graphql b/backend/database/datamodel.graphql index f31a089..43ae403 100644 --- a/backend/database/datamodel.graphql +++ b/backend/database/datamodel.graphql @@ -1,11 +1,11 @@ -type Post { - id: ID! @unique - createdAt: DateTime! - updatedAt: DateTime! - isPublished: Boolean! @default(value: "false") - title: String! - text: String! - author: User! +enum Permission { + ADMIN + USER + ITEMCREATE + ITEMUPDATE + ITEMDELETE + PERMISSIONUPDATE + NUKE } type User { @@ -13,15 +13,13 @@ type User { email: String! @unique password: String! name: String! - posts: [Post!]! orders: [Order!]! - website: String - age: Int resetToken: String resetTokenExpiry: String cart: [CartItem!]! createdAt: DateTime! updatedAt: DateTime! + permissions: [Permission!]! } type CartItem { @@ -42,6 +40,7 @@ type Item { price: Int! createdAt: DateTime! updatedAt: DateTime! + user: User! # Relationship to a user } type OrderItem { diff --git a/backend/database/prisma.yml b/backend/database/prisma.yml index b01378b..b52f72b 100644 --- a/backend/database/prisma.yml +++ b/backend/database/prisma.yml @@ -16,5 +16,6 @@ datamodel: datamodel.graphql # import: seed.graphql # cluster: ${env:PRISMA_CLUSTER} -cluster: local +# cluster: local +# cluster: wesbos/prisma-us1 \ No newline at end of file -- cgit v1.3