Skip to content

Commit

Permalink
🐛 Fix check when globalRole is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov committed May 9, 2022
1 parent 0380403 commit 3f2c4a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cli/src/CredentialsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ export function whereClause({
}): WhereClause {
const where: WhereClause = entityId ? { [entityType]: { id: entityId } } : {};

if (user.globalRole.name !== 'owner') {
if (user?.globalRole?.name !== 'owner') {
where.user = { id: user.id };
}

Expand Down

0 comments on commit 3f2c4a6

Please sign in to comment.