1
0
Fork 0
mirror of synced 2024-09-28 07:21:35 +12:00

Fix team membership delete

This commit is contained in:
Jake Barnby 2022-08-15 18:04:00 +12:00
parent 86f209800a
commit 66f518b531

View file

@ -831,6 +831,14 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId')
throw new Exception('Team not found', 404, Exception::TEAM_NOT_FOUND);
}
/**
* Force document security
*/
$validator = new Authorization('delete');
if (!$validator->isValid($membership->getDelete())) {
throw new Exception('Unauthorized permissions', 401, Exception::USER_UNAUTHORIZED);
}
try {
$dbForProject->deleteDocument('memberships', $membership->getId());
} catch (AuthorizationException $exception) {