Merge branch 'main' into recent-activity

# Conflicts:
#	.config/dotnet-tools.json
#	ProjectLighthouse.Servers.Website/Pages/Partials/ReviewPartial.cshtml
This commit is contained in:
Slendy 2024-04-01 14:45:59 -05:00
commit 8f91875f7c
No known key found for this signature in database
GPG key ID: 7288D68361B91428
54 changed files with 459 additions and 48 deletions

View file

@ -43,6 +43,9 @@ public class PublishController : ControllerBase
UserEntity? user = await this.database.UserFromGameToken(token);
if (user == null) return this.Forbid();
// Deny request if in read-only mode
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
GameUserSlot? slot = await this.DeserializeBody<GameUserSlot>();
if (slot == null)
{
@ -116,6 +119,9 @@ public class PublishController : ControllerBase
UserEntity? user = await this.database.UserFromGameToken(token);
if (user == null) return this.Forbid();
// Deny request if in read-only mode
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
GameUserSlot? slot = await this.DeserializeBody<GameUserSlot>();
if (slot == null)
@ -335,6 +341,9 @@ public class PublishController : ControllerBase
{
GameTokenEntity token = this.GetToken();
// Deny request if in read-only mode
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
SlotEntity? slot = await this.database.Slots.FirstOrDefaultAsync(s => s.SlotId == id);
if (slot == null) return this.NotFound();