summaryrefslogtreecommitdiffstats
path: root/stepped-solutions/54/backend/src/resolvers
diff options
context:
space:
mode:
Diffstat (limited to 'stepped-solutions/54/backend/src/resolvers')
-rwxr-xr-xstepped-solutions/54/backend/src/resolvers/Query.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/stepped-solutions/54/backend/src/resolvers/Query.js b/stepped-solutions/54/backend/src/resolvers/Query.js
index 22a6414..3ee1118 100755
--- a/stepped-solutions/54/backend/src/resolvers/Query.js
+++ b/stepped-solutions/54/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