From c3d889c92d8eacfd93bab2dbc2e9a4db61d9aae7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 20 Mar 2020 15:18:29 +0300 Subject: enable spring boot actuator for admin users --- src/main/java/com/juick/service/security/entities/JuickUser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/juick/service/security/entities') 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 USER_AUTHORITY = Collections.singletonList(ROLE_USER); public static final List ANONYMOUS_AUTHORITY = Collections.singletonList(ROLE_ANONYMOUS); + public static final List ADMIN_AUTHORITY = List.of(ROLE_ADMIN, ROLE_USER); public static final JuickUser ANONYMOUS_USER = new JuickUser(AnonymousUser.INSTANCE, ANONYMOUS_AUTHORITY); -- cgit v1.2.3