updated mail properties
This commit is contained in:
@@ -17,11 +17,13 @@ import net.gepafin.tendermanagement.web.rest.api.errors.Status;
|
||||
import net.gepafin.tendermanagement.web.rest.api.errors.UnauthorizedAccessException;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@@ -38,6 +40,9 @@ public class Validator {
|
||||
|
||||
@Autowired
|
||||
private CallService callService;
|
||||
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
|
||||
public Map<String, Object> getUserInfoFromToken(HttpServletRequest request) {
|
||||
return tokenProvider.getUserInfoAndUserIdFromToken(request);
|
||||
@@ -114,6 +119,9 @@ public class Validator {
|
||||
return callEntity;
|
||||
}
|
||||
|
||||
|
||||
public Boolean isProductionProfileActivated() {
|
||||
String[] activeProfiles = environment.getActiveProfiles();
|
||||
return Arrays.stream(activeProfiles).anyMatch("production"::equals);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user