Merge pull request 'Remove UserGroup' (#58) from removeUserGroups into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #58
Reviewed-by: Chaoscaot <chaoscaot@zohomail.eu>
Dieser Commit ist enthalten in:
Lixfel 2023-10-10 18:00:58 +02:00
Commit e4b3539d28
2 geänderte Dateien mit 1 neuen und 66 gelöschten Zeilen

Datei anzeigen

@ -36,7 +36,6 @@ public class SteamwarUser {
String l = rs.getString(identifier);
return l != null ? Locale.forLanguageTag(l) : null;
}, (st, index, value) -> st.setString(index, value.toLanguageTag()));
SqlTypeMapper.nameEnumMapper(UserGroup.class);
new SqlTypeMapper<>(SteamwarUser.class, null, (rs, identifier) -> { throw new SecurityException("SteamwarUser cannot be used as type (recursive select)"); }, (st, index, value) -> st.setInt(index, value.id));
}
@ -149,10 +148,6 @@ public class SteamwarUser {
@Getter
@Field
private String userName;
@Deprecated
@Getter
@Field(def = "'Member'")
private final UserGroup userGroup;
@Getter
@Field(def = "0")
private int team;
@ -171,11 +166,10 @@ public class SteamwarUser {
private Set<UserPerm> permissions = null;
private UserPerm.Prefix prefix = null;
public SteamwarUser(int id, UUID uuid, String userName, UserGroup userGroup, int team, boolean leader, Locale locale, boolean manualLocale, Long discordId) {
public SteamwarUser(int id, UUID uuid, String userName, int team, boolean leader, Locale locale, boolean manualLocale, Long discordId) {
this.id = id;
this.uuid = uuid;
this.userName = userName;
this.userGroup = userGroup;
this.team = team;
this.leader = leader;
this.locale = locale;

Datei anzeigen

@ -1,59 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2023 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.sql;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Deprecated
@AllArgsConstructor
public enum UserGroup {
Admin("§4", "§e", "Admin", true, true, true, true),
Developer("§3", "§f", "Dev", true, true, true, true),
Moderator("§c", "§f", "Mod", true, true, true, true),
Supporter("§9", "§f", "Sup", false, true, true, true),
Builder("§2", "§f", "Arch", false, true, false, true),
YouTuber("§5", "§f", "YT", false, false, false, true),
Member("§7", "§7", "", false, false, false, false);
@Getter
private final String colorCode;
@Getter
private final String chatColorCode;
@Getter
private final String chatPrefix;
@Getter
private final boolean adminGroup;
@Getter
private final boolean teamGroup;
@Getter
private final boolean checkSchematics;
@Getter
private final boolean privilegedMods;
public static UserGroup getUsergroup(String name) {
for(UserGroup group : values()) {
if(group.name().equalsIgnoreCase(name))
return group;
}
throw new IllegalArgumentException(name);
}
}