mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-13 13:22:28 +00:00
Use Unauthorized instead of Forbid on Website & Api
This commit is contained in:
parent
b0858448c8
commit
a603cdb002
2 changed files with 4 additions and 4 deletions
|
@ -24,7 +24,7 @@ public class ModerationSlotController : ControllerBase
|
|||
public async Task<IActionResult> TeamPick([FromRoute] int id)
|
||||
{
|
||||
UserEntity? user = this.database.UserFromWebRequest(this.Request);
|
||||
if (user == null || !user.IsModerator) return this.Forbid();
|
||||
if (user == null || !user.IsModerator) return this.Unauthorized();
|
||||
|
||||
SlotEntity? slot = await this.database.Slots.Include(s => s.Creator).FirstOrDefaultAsync(s => s.SlotId == id);
|
||||
if (slot == null) return this.NotFound();
|
||||
|
@ -43,7 +43,7 @@ public class ModerationSlotController : ControllerBase
|
|||
public async Task<IActionResult> RemoveTeamPick([FromRoute] int id)
|
||||
{
|
||||
UserEntity? user = this.database.UserFromWebRequest(this.Request);
|
||||
if (user == null || !user.IsModerator) return this.Forbid();
|
||||
if (user == null || !user.IsModerator) return this.Unauthorized();
|
||||
|
||||
SlotEntity? slot = await this.database.Slots.FirstOrDefaultAsync(s => s.SlotId == id);
|
||||
if (slot == null) return this.NotFound();
|
||||
|
@ -59,7 +59,7 @@ public class ModerationSlotController : ControllerBase
|
|||
public async Task<IActionResult> DeleteLevel([FromRoute] int id)
|
||||
{
|
||||
UserEntity? user = this.database.UserFromWebRequest(this.Request);
|
||||
if (user == null || !user.IsModerator) return this.Forbid();
|
||||
if (user == null || !user.IsModerator) return this.Unauthorized();
|
||||
|
||||
SlotEntity? slot = await this.database.Slots.FirstOrDefaultAsync(s => s.SlotId == id);
|
||||
if (slot == null) return this.Ok();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue