summaryrefslogtreecommitdiffstats
path: root/finished-application
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-12-07 13:32:50 -0500
committerGitHub <noreply@github.com>2018-12-07 13:32:50 -0500
commit1364d736d2f05beb8e6a2f6672c7c8fc32dcc075 (patch)
tree58a45f65d79736b58589b6f2efb9f4ab2cf4c549 /finished-application
parent44a7fbee19b3dfb2257282ed040ce91907b016d4 (diff)
parent85438f81b90481f9d23fe8afae6b3263a6819391 (diff)
Merge pull request #129 from zainfathoni/mastermaster
Fix view permission checking in order query
Diffstat (limited to 'finished-application')
-rw-r--r--finished-application/backend/src/resolvers/Query.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/finished-application/backend/src/resolvers/Query.js b/finished-application/backend/src/resolvers/Query.js
index 22a6414..3ee1118 100644
--- a/finished-application/backend/src/resolvers/Query.js
+++ b/finished-application/backend/src/resolvers/Query.js
@@ -44,7 +44,7 @@ const Query = {
// 3. Check if the have the permissions to see this order
const ownsOrder = order.user.id === ctx.request.userId;
const hasPermissionToSeeOrder = ctx.request.user.permissions.includes('ADMIN');
- if (!ownsOrder || !hasPermission) {
+ if (!ownsOrder && !hasPermissionToSeeOrder) {
throw new Error('You cant see this buddd');
}
// 4. Return the order