diff options
author | Vitaly Takmazov | 2020-03-20 15:18:29 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2020-03-20 15:18:29 +0300 |
commit | c3d889c92d8eacfd93bab2dbc2e9a4db61d9aae7 (patch) | |
tree | 1f9d64442f0ef7acf9f88840f9320b82bc605c7f /src/main/java/com/juick/service/security/entities | |
parent | bdef56b6fc58dc3554171f3e14ac821655cb8ddd (diff) |
enable spring boot actuator for admin users
Diffstat (limited to 'src/main/java/com/juick/service/security/entities')
-rw-r--r-- | src/main/java/com/juick/service/security/entities/JuickUser.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/juick/service/security/entities/JuickUser.java b/src/main/java/com/juick/service/security/entities/JuickUser.java index 062db3a4..dca5fe7d 100644 --- a/src/main/java/com/juick/service/security/entities/JuickUser.java +++ b/src/main/java/com/juick/service/security/entities/JuickUser.java @@ -17,8 +17,8 @@ package com.juick.service.security.entities; -import com.juick.model.User; import com.juick.model.AnonymousUser; +import com.juick.model.User; import org.apache.commons.lang3.StringUtils; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; @@ -33,10 +33,12 @@ import java.util.List; */ public class JuickUser implements UserDetails { static final GrantedAuthority ROLE_USER = new SimpleGrantedAuthority("ROLE_USER"); + static final GrantedAuthority ROLE_ADMIN = new SimpleGrantedAuthority("ROLE_ADMIN"); static final GrantedAuthority ROLE_ANONYMOUS = new SimpleGrantedAuthority("ROLE_ANONYMOUS"); public static final List<GrantedAuthority> USER_AUTHORITY = Collections.singletonList(ROLE_USER); public static final List<GrantedAuthority> ANONYMOUS_AUTHORITY = Collections.singletonList(ROLE_ANONYMOUS); + public static final List<GrantedAuthority> ADMIN_AUTHORITY = List.of(ROLE_ADMIN, ROLE_USER); public static final JuickUser ANONYMOUS_USER = new JuickUser(AnonymousUser.INSTANCE, ANONYMOUS_AUTHORITY); |