mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-31 09:18:38 +00:00
Implement basic privacy settings (#392)
* Add ability for clients to submit and retrieve privacy settings data * Make slot pages and user pages respect user's privacy settings * Prevent webhook from publishing new levels if user's privacy settings disallow it * Hide levels/profiles from respective pages depending on privacy settings * Apply suggestions from review
This commit is contained in:
parent
5a3439e634
commit
2ab1e72037
12 changed files with 210 additions and 12 deletions
|
@ -3,6 +3,7 @@ using System.Text;
|
|||
using LBPUnion.ProjectLighthouse.Configuration;
|
||||
using LBPUnion.ProjectLighthouse.Levels;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||
using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
@ -70,6 +71,7 @@ public class SlotsPage : BaseLayout
|
|||
.Where(p => p.Type == SlotType.User)
|
||||
.Where(p => p.Name.Contains(finalSearch.ToString()))
|
||||
.Where(p => p.Creator != null && (targetAuthor == null || string.Equals(p.Creator.Username.ToLower(), targetAuthor.ToLower())))
|
||||
.Where(p => p.Creator!.LevelVisibility == PrivacyType.All) // TODO: change check for when user is logged in
|
||||
.Where(p => targetGame == null || p.GameVersion == targetGame)
|
||||
.OrderByDescending(p => p.FirstUploaded)
|
||||
.Skip(pageNumber * ServerStatics.PageSize)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue