fix security configuration
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.test.test.rest
|
||||
|
||||
import com.auth.config.WebSecurityConfig
|
||||
import org.springframework.security.access.prepost.PreAuthorize
|
||||
import org.springframework.security.core.Authentication
|
||||
import org.springframework.security.core.context.SecurityContextHolder
|
||||
@@ -10,9 +11,13 @@ import org.springframework.web.bind.annotation.RestController
|
||||
@RestController
|
||||
open class TestController {
|
||||
|
||||
private val logger = org.slf4j.LoggerFactory.getLogger(TestController::class.java)
|
||||
|
||||
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
@GetMapping("/test")
|
||||
fun test(): String {
|
||||
logger.info("test!")
|
||||
return "Test page"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user