Allow viewing room visualizer on release if user is admin

This commit is contained in:
jvyden 2022-01-18 20:40:16 -05:00
commit 303fb878ea
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -1,3 +1,4 @@
#nullable enable
using System.Threading.Tasks; using System.Threading.Tasks;
using JetBrains.Annotations; using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Pages.Layouts;
@ -13,7 +14,10 @@ public class RoomVisualizerPage : BaseLayout
public async Task<IActionResult> OnGet() public async Task<IActionResult> OnGet()
{ {
#if !DEBUG #if !DEBUG
return this.NotFound(); User? user = this.Database.UserFromWebRequest(this.Request);
if (user == null || !user.IsAdmin) return this.NotFound();
return this.Page();
#else #else
return this.Page(); return this.Page();
#endif #endif