mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-06-28 12:08:09 +03:00
[FIX] Support profile limited
This commit is contained in:
parent
183d0fc9df
commit
68e2230d34
1 changed files with 19 additions and 1 deletions
|
@ -79,7 +79,25 @@ public void delete(UncompletedProfile profile) {
|
|||
|
||||
@Override
|
||||
public Set<UncompletedProfile> getProfiles(Client client) {
|
||||
return new HashSet<>(profilesMap.values());
|
||||
if(client == null) {
|
||||
return new HashSet<>(profilesMap.values());
|
||||
}
|
||||
if(!client.isAuth) {
|
||||
return new HashSet<>();
|
||||
}
|
||||
Set<UncompletedProfile> 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
|
||||
|
|
Loading…
Reference in a new issue