Hardened API and catered for Partner role query filter bypass

This commit is contained in:
2026-10-04 08:18:43 +02:00
parent 8d069c2da0
commit 8100518549
62 changed files with 232 additions and 193 deletions
@@ -98,7 +98,7 @@ public sealed class UserService(IDbContextFactory<ApplicationDbContext> contextF
changedTotal += await context.Users.Where(f => f.Id == userId)
.ExecuteUpdateAsync(f => f.SetProperty(u => u.Status, status), cancellationToken);
return Result.OkIf(changedTotal > 0, UpdateError.New);
return Result.OkIf(changedTotal > 0, UpdateError.Create("Failed to update user status."));
}));
public async Task<Result<User>> GetUserAsync(Guid userId, CancellationToken cancellationToken) =>
@@ -110,7 +110,7 @@ public sealed class UserService(IDbContextFactory<ApplicationDbContext> contextF
.Include(i => i.User)
.FirstOrDefaultAsync(f => f.UserId == userId, cancellationToken);
return Result.FailIf(tenantUser == null, NotFoundError.New)
return Result.FailIf(tenantUser == null, NotFoundError.Create("User not found."))
.ToResult(tenantUser!.User?.Map()!);
}));
}