mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
Fix job ownership verification (#132)
This commit is contained in:
committed by
GitHub
parent
2194ffe0f4
commit
111c154ae3
@@ -15,7 +15,7 @@ function doesJobBelongsToUser(job, req) {
|
||||
if (user == null) {
|
||||
return false;
|
||||
}
|
||||
return user.isAdmin || job.userId === job.userId;
|
||||
return user.isAdmin || job.userId === user.id;
|
||||
}
|
||||
jobRouter.get('/', async (req, res) => {
|
||||
const isUserAdmin = isAdmin(req);
|
||||
|
||||
Reference in New Issue
Block a user