Last change
on this file since 950fa0d was 8bcd64c, checked in by Gjoko Kostadinov <gjoko.kostadinov@…>, 15 months ago |
Add admin functionality and business admin functionality.
|
-
Property mode
set to
100644
|
File size:
920 bytes
|
Rev | Line | |
---|
[46fd0c7] | 1 | package edu.gjoko.schedlr.controllers;
|
---|
| 2 |
|
---|
[8bcd64c] | 3 | import org.springframework.security.core.Authentication;
|
---|
| 4 | import org.springframework.security.core.context.SecurityContextHolder;
|
---|
[46fd0c7] | 5 | import org.springframework.stereotype.Controller;
|
---|
| 6 | import org.springframework.ui.Model;
|
---|
| 7 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
| 8 |
|
---|
[8bcd64c] | 9 | import javax.servlet.http.HttpServletRequest;
|
---|
| 10 | import java.security.Principal;
|
---|
| 11 |
|
---|
[46fd0c7] | 12 | @Controller
|
---|
| 13 | public class AdminController {
|
---|
| 14 |
|
---|
| 15 | @GetMapping(path = "/admin")
|
---|
[8bcd64c] | 16 | public String getAdminPageTemplate(Model model, HttpServletRequest request) {
|
---|
[46fd0c7] | 17 | return "admin";
|
---|
| 18 | }
|
---|
[8bcd64c] | 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 |
|
---|
[46fd0c7] | 29 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.