mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-30 04:32:27 +00:00
Add ability to hide levels
This commit is contained in:
parent
0d7d8c25f3
commit
ef6acbb210
11 changed files with 106 additions and 32 deletions
|
@ -26,8 +26,7 @@ public class SlotPage : BaseLayout
|
|||
|
||||
public async Task<IActionResult> OnGet([FromRoute] int id)
|
||||
{
|
||||
Slot? slot = await this.Database.Slots.Include
|
||||
(s => s.Creator)
|
||||
Slot? slot = await this.Database.Slots.Include(s => s.Creator)
|
||||
.Where(s => s.Type == SlotType.User)
|
||||
.FirstOrDefaultAsync(s => s.SlotId == id);
|
||||
if (slot == null) return this.NotFound();
|
||||
|
@ -55,6 +54,8 @@ public class SlotPage : BaseLayout
|
|||
}
|
||||
}
|
||||
|
||||
if (slot.Hidden && (this.User != slot.Creator && !(bool)this.User?.IsModerator)) return this.NotFound();
|
||||
|
||||
this.Slot = slot;
|
||||
|
||||
if (this.CommentsEnabled)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue