Migrate authentication to beans.
This commit is contained in:
@@ -30,14 +30,16 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@PreAuthorize("isAuthenticated() and hasRole('ROLE_ADMIN')")
|
||||
public class AdminController extends BaseController {
|
||||
@Qualifier("userService")
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user