- Timestamp:
- 04/19/23 21:19:08 (19 months ago)
- Branches:
- master
- Children:
- 950fa0d
- Parents:
- 9050790
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/edu/gjoko/schedlr/controllers/AdminController.java
r9050790 r8bcd64c 1 1 package edu.gjoko.schedlr.controllers; 2 2 3 import org.springframework.security.core.Authentication; 4 import org.springframework.security.core.context.SecurityContextHolder; 3 5 import org.springframework.stereotype.Controller; 4 6 import org.springframework.ui.Model; 5 7 import org.springframework.web.bind.annotation.GetMapping; 8 9 import javax.servlet.http.HttpServletRequest; 10 import java.security.Principal; 6 11 7 12 @Controller … … 9 14 10 15 @GetMapping(path = "/admin") 11 public String getAdminPageTemplate(Model model ) {16 public String getAdminPageTemplate(Model model, HttpServletRequest request) { 12 17 return "admin"; 13 18 } 19 20 @GetMapping(path = "/business_admin") 21 public String getBusinessAdminPageTemplate(Model model, HttpServletRequest request) { 22 Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); 23 String currentPrincipalName = authentication.getName(); 24 25 return "business_admin"; 26 } 27 28 14 29 }
Note:
See TracChangeset
for help on using the changeset viewer.