From 303fb878eac8e6b56a8803a07ef7ccbea2b3b0d4 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 18 Jan 2022 20:40:16 -0500 Subject: [PATCH] Allow viewing room visualizer on release if user is admin --- ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs b/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs index 3966e460..1b3a1085 100644 --- a/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs +++ b/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs @@ -1,3 +1,4 @@ +#nullable enable using System.Threading.Tasks; using JetBrains.Annotations; using LBPUnion.ProjectLighthouse.Pages.Layouts; @@ -13,7 +14,10 @@ public class RoomVisualizerPage : BaseLayout public async Task OnGet() { #if !DEBUG - return this.NotFound(); + User? user = this.Database.UserFromWebRequest(this.Request); + if (user == null || !user.IsAdmin) return this.NotFound(); + + return this.Page(); #else return this.Page(); #endif