Created
March 1, 2021 10:42
-
-
Save Enigo/8ffa9d7a7e998050fe5667d68c85a1cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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