From cbec25cd6b5fe37f3010ab163b1bca61a743c457 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sun, 8 May 2022 04:21:35 +0200 Subject: User -> portal, Admin -> admin Signed-off-by: Georg Pfuetzenreuter --- src/main/java/net/libertacasa/pubsh/web/SecurityConfig.java | 1 + src/main/java/net/libertacasa/pubsh/web/WebApplication.java | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/main/java/net/libertacasa/pubsh') diff --git a/src/main/java/net/libertacasa/pubsh/web/SecurityConfig.java b/src/main/java/net/libertacasa/pubsh/web/SecurityConfig.java index 53f83ab..14b6dcb 100644 --- a/src/main/java/net/libertacasa/pubsh/web/SecurityConfig.java +++ b/src/main/java/net/libertacasa/pubsh/web/SecurityConfig.java @@ -36,6 +36,7 @@ public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter { http .authorizeRequests() .antMatchers("/portal").hasAuthority("devel-user") + .antMatchers("/admin").hasAuthority("devel-admins") .anyRequest().permitAll(); } } diff --git a/src/main/java/net/libertacasa/pubsh/web/WebApplication.java b/src/main/java/net/libertacasa/pubsh/web/WebApplication.java index d4094f6..ad9ed9b 100644 --- a/src/main/java/net/libertacasa/pubsh/web/WebApplication.java +++ b/src/main/java/net/libertacasa/pubsh/web/WebApplication.java @@ -45,7 +45,7 @@ public class WebApplication { } - @GetMapping("/portal") + @GetMapping("/admin") public String portal(Model model) throws pubshError { KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken) SecurityContextHolder.getContext().getAuthentication(); @@ -101,10 +101,10 @@ public class WebApplication { model.addAttribute("availableOs", availableOs); //model.addAttribute("osChoice", new String()); - return("portal"); + return("admin"); } - @GetMapping("/user") + @GetMapping("/portal") public String user(Model model) throws pubshError { KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken) SecurityContextHolder.getContext().getAuthentication(); @@ -146,7 +146,7 @@ public class WebApplication { model.addAttribute("docker_containers", containers); model.addAttribute("availableOs", availableOs); - return("user"); + return("portal"); } @DeleteMapping("/frontend/container/delete/{id}") -- cgit v1.2.3