Allow moderators to dismiss reports

This commit is contained in:
Slendy 2022-11-17 16:14:03 -06:00
parent e67abe0164
commit c6ddeaf154
No known key found for this signature in database
GPG key ID: 7288D68361B91428

View file

@ -55,7 +55,7 @@ public class AdminReportController : ControllerBase
public async Task<IActionResult> DismissReport([FromRoute] int id)
{
User? user = this.database.UserFromWebRequest(this.Request);
if (user == null || !user.IsAdmin) return this.StatusCode(403, "");
if (user == null || !user.IsModerator) return this.StatusCode(403, "");
GriefReport? report = await this.database.Reports.FirstOrDefaultAsync(r => r.ReportId == id);
if (report == null) return this.NotFound();