Fix cross-user job history leak
This commit is contained in:
@@ -85,6 +85,9 @@ namespace JobTrackerApi.Data
|
||||
.HasForeignKey(a => a.JobApplicationId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
modelBuilder.Entity<JobEvent>()
|
||||
.HasQueryFilter(x => CurrentUserId != null && x.JobApplication.OwnerUserId == CurrentUserId);
|
||||
|
||||
modelBuilder.Entity<JobEvent>()
|
||||
.HasOne(e => e.JobApplication)
|
||||
.WithMany(j => j.Events)
|
||||
|
||||
Reference in New Issue
Block a user