Skip to content

Instantly share code, notes, and snippets.

@Enigo
Created March 1, 2021 10:42
@RequiredArgsConstructor
public enum Role implements GrantedAuthority {
ADMIN(Code.ADMIN),
USER(Code.USER);
private final String authority;
@Override
public String getAuthority() {
return authority;
}
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public static class Code {
public static final String ADMIN = "ROLE_ADMIN";
public static final String USER = "ROLE_USER";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment