Skip to content

Commit

Permalink
use partyId instead of userId to get systemuser to delete
Browse files Browse the repository at this point in the history
  • Loading branch information
mgunnerud committed Sep 25, 2024
1 parent aa6a7c7 commit 4dc1aaf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public async void Put(Guid id, [FromBody] CreateSystemUserRequestGUI modifiedSys
[HttpDelete("{id}")]
public async Task<ActionResult> Delete(Guid id, CancellationToken cancellationToken = default)
{
int partyId = AuthenticationHelper.GetUsersPartyId(_httpContextAccessor.HttpContext!);
int partyId = AuthenticationHelper.GetRepresentingPartyId(_httpContextAccessor.HttpContext!);
var toBeDeleted = await _systemUserService.GetSpecificSystemUserDTO(partyId, id, cancellationToken);
if (toBeDeleted == null) return NotFound();
if (partyId.ToString() != toBeDeleted.PartyId) return BadRequest();
Expand Down

0 comments on commit 4dc1aaf

Please sign in to comment.