diff --git a/src/main/java/com/botdetector/model/AuthTokenType.java b/src/main/java/com/botdetector/model/AuthTokenType.java index 1bd39a22..27055519 100644 --- a/src/main/java/com/botdetector/model/AuthTokenType.java +++ b/src/main/java/com/botdetector/model/AuthTokenType.java @@ -26,38 +26,45 @@ package com.botdetector.model; import com.google.common.collect.ImmutableSet; -import java.util.Arrays; import lombok.Getter; -import lombok.RequiredArgsConstructor; import static com.botdetector.model.AuthTokenPermission.*; @Getter -@RequiredArgsConstructor public enum AuthTokenType { /** * No permissions */ - NONE(ImmutableSet.of()), + NONE(), /** * All permissions */ - DEV(Arrays.stream(AuthTokenPermission.values()).collect(ImmutableSet.toImmutableSet())), + DEV(AuthTokenPermission.values()), /** * Can perform discord verification and retrieve clan rank updates */ - MOD(ImmutableSet.of(VERIFY_DISCORD, GET_CLAN_RANK_UPDATES)), + MOD(VERIFY_DISCORD, GET_CLAN_RANK_UPDATES), + + /** + * Can perform discord verification + */ + DISCORD(VERIFY_DISCORD), /** * Can retrieve clan rank updates */ - CLAN(ImmutableSet.of(GET_CLAN_RANK_UPDATES)) + CLAN(GET_CLAN_RANK_UPDATES) ; private final ImmutableSet permissions; + AuthTokenType(AuthTokenPermission... permissions) + { + this.permissions = ImmutableSet.copyOf(permissions); + } + /** * Parses the token type from the given {@code prefix}. * @param prefix The prefix to parse.