From 68e2230d34aba3ed0fb4f8f05a577bf058f01a72 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sun, 22 Jun 2025 17:58:34 +0700 Subject: [PATCH] [FIX] Support profile limited --- .../auth/profiles/LocalProfilesProvider.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/profiles/LocalProfilesProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/profiles/LocalProfilesProvider.java index e7b7e662..f0b83016 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/profiles/LocalProfilesProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/profiles/LocalProfilesProvider.java @@ -79,7 +79,25 @@ public void delete(UncompletedProfile profile) { @Override public Set getProfiles(Client client) { - return new HashSet<>(profilesMap.values()); + if(client == null) { + return new HashSet<>(profilesMap.values()); + } + if(!client.isAuth) { + return new HashSet<>(); + } + Set profiles = new HashSet<>(); + for(var p : profilesMap.entrySet()) { + var uuid = p.getKey(); + var profile = p.getValue(); + if(profile.getProfile() != null && profile.getProfile().isLimited()) { + if(client.isAuth && client.permissions != null && client.permissions.hasPerm(String.format("launchserver.profile.%s.show", uuid))) { + profiles.add(profile); + } + } else { + profiles.add(profile); + } + } + return profiles; } @Override