Skip to content

Commit

Permalink
fix(contributors): allow an editor to view a specific user details
Browse files Browse the repository at this point in the history
  • Loading branch information
lutangar committed Jan 30, 2024
1 parent 2469d24 commit 7b6f26d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/backend/src/auth/can-get-user.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export class CanGetUserGuard extends AuthGuard('local') {
if (userCredentials === null) {
return false;
}
return userCredentials.role === Roles.ADMIN || parseInt(request.params.id) === userCredentials.id;

return (
[Roles.ADMIN, Roles.EDITOR].includes(userCredentials.role) || parseInt(request.params.id) === userCredentials.id
);
}
}

0 comments on commit 7b6f26d

Please sign in to comment.