Ignore:
Timestamp:
04/19/23 21:19:08 (19 months ago)
Author:
Gjoko Kostadinov <gjoko.kostadinov@…>
Branches:
master
Children:
950fa0d
Parents:
9050790
Message:

Add admin functionality and business admin functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/edu/gjoko/schedlr/controllers/AdminController.java

    r9050790 r8bcd64c  
    11package edu.gjoko.schedlr.controllers;
    22
     3import org.springframework.security.core.Authentication;
     4import org.springframework.security.core.context.SecurityContextHolder;
    35import org.springframework.stereotype.Controller;
    46import org.springframework.ui.Model;
    57import org.springframework.web.bind.annotation.GetMapping;
     8
     9import javax.servlet.http.HttpServletRequest;
     10import java.security.Principal;
    611
    712@Controller
     
    914
    1015    @GetMapping(path = "/admin")
    11     public String getAdminPageTemplate(Model model) {
     16    public String getAdminPageTemplate(Model model, HttpServletRequest request) {
    1217        return "admin";
    1318    }
     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
    1429}
Note: See TracChangeset for help on using the changeset viewer.