Skip to content

Commit

Permalink
check project owner is not removed
Browse files Browse the repository at this point in the history
  • Loading branch information
rsiminel committed Dec 9, 2024
1 parent 7590477 commit 85bcd13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routes/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,10 @@ router.delete('/user/:id/project/:project', async function(req, res) {
res.status(404).send({ message: 'Project not found' });
return;
}

if (project.owner == uid) {
res.status(400).send({ message: 'Can not remove project owner' });
return;
}
if (!isadmin && session_user.uid != project.owner && session_user.uid != uid) {
res.status(401).send({ message: 'Not authorized' });
return;
Expand Down

0 comments on commit 85bcd13

Please sign in to comment.