Class AdminController
java.lang.Object
fr.utc.miage.sporttrack.controller.AdminController
Spring MVC controller for the administrator home page.
Checks that the current user has admin privileges before granting access to the admin dashboard.
- Author:
- SportTrack Team
-
Constructor Summary
ConstructorsConstructorDescriptionAdminController(AdminService adminService) Constructs anAdminControllerwith the required service. -
Method Summary
-
Constructor Details
-
AdminController
Constructs anAdminControllerwith the required service.- Parameters:
adminService- the admin service for authentication checks
-
-
Method Details
-
home
@GetMapping("") public String home(org.springframework.ui.Model model, org.springframework.security.core.Authentication auth) Renders the admin home page if the current user is an authenticated admin.- Parameters:
model- the Spring MVC modelauth- the current security authentication- Returns:
- the view name "admin/home", or a redirect to login if not an admin
-