fix authorize issue on penalty info after upgrading .NET Core runtime targets
This commit is contained in:
parent
c4df53c195
commit
c9e6ce0bca
@ -115,6 +115,11 @@ namespace IW4MAdmin.Plugins.Web.StatsWeb.Controllers
|
|||||||
.Select(_penalty => new { _penalty.OffenderId, _penalty.PenaltyId, _penalty.When, _penalty.AutomatedOffense })
|
.Select(_penalty => new { _penalty.OffenderId, _penalty.PenaltyId, _penalty.When, _penalty.AutomatedOffense })
|
||||||
.FirstOrDefaultAsync(_penalty => _penalty.PenaltyId == penaltyId);
|
.FirstOrDefaultAsync(_penalty => _penalty.PenaltyId == penaltyId);
|
||||||
|
|
||||||
|
if (penalty == null)
|
||||||
|
{
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
// todo: this can be optimized
|
// todo: this can be optimized
|
||||||
var iqSnapshotInfo = ctx.Set<Stats.Models.EFACSnapshot>()
|
var iqSnapshotInfo = ctx.Set<Stats.Models.EFACSnapshot>()
|
||||||
.Where(s => s.ClientId == penalty.OffenderId)
|
.Where(s => s.ClientId == penalty.OffenderId)
|
||||||
|
@ -50,6 +50,8 @@ namespace SharedLibraryCore.Services
|
|||||||
NetworkId = entity.NetworkId
|
NetworkId = entity.NetworkId
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
entity.CurrentServer.Logger.WriteDebug($"[create] adding {entity} to context");
|
||||||
context.Clients.Add(client);
|
context.Clients.Add(client);
|
||||||
|
|
||||||
// they're just using a new GUID
|
// they're just using a new GUID
|
||||||
|
@ -114,13 +114,13 @@ namespace WebfrontCore
|
|||||||
|
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseAuthorization();
|
|
||||||
app.UseCors("AllowAll");
|
app.UseCors("AllowAll");
|
||||||
|
|
||||||
// prevents banned/demoted users from keeping their claims
|
// prevents banned/demoted users from keeping their claims
|
||||||
app.UseMiddleware<ClaimsPermissionRemoval>(Program.Manager);
|
app.UseMiddleware<ClaimsPermissionRemoval>(Program.Manager);
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
app.UseAuthorization();
|
||||||
app.UseEndpoints(endpoints =>
|
app.UseEndpoints(endpoints =>
|
||||||
{
|
{
|
||||||
endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
|
endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
|
||||||
|
Loading…
Reference in New Issue
Block a user