fix: cannot delete resource when you are not on root team
This commit is contained in:
parent
9dfde11e35
commit
c0940f7a19
@ -736,7 +736,7 @@ export async function deleteApplication(
|
||||
where: { id },
|
||||
include: { destinationDocker: true, teams: true }
|
||||
});
|
||||
if (teamId !== '0' || !application.teams.some((team) => team.id === teamId)) {
|
||||
if (teamId !== '0' && !application.teams.some((team) => team.id === teamId)) {
|
||||
throw { status: 403, message: 'You are not allowed to delete this application.' };
|
||||
}
|
||||
if (application?.destinationDocker?.id && application.destinationDocker?.network) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user