Skip to content

Instantly share code, notes, and snippets.

@Enigo
Created March 1, 2021 10:42
Show Gist options
  • Save Enigo/8ffa9d7a7e998050fe5667d68c85a1cf to your computer and use it in GitHub Desktop.
Save Enigo/8ffa9d7a7e998050fe5667d68c85a1cf to your computer and use it in GitHub Desktop.
@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