mirror of
https://github.com/gotson/komga.git
synced 2026-05-04 04:43:46 +02:00
refactor: harmonize hasRole conditions
This commit is contained in:
parent
838d02fd0e
commit
f052d2c862
5 changed files with 7 additions and 7 deletions
|
|
@ -16,7 +16,7 @@ private val logger = KotlinLogging.logger {}
|
|||
|
||||
@RestController
|
||||
@RequestMapping("api/v1/admin")
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
class AdminController(
|
||||
private val asyncOrchestrator: AsyncOrchestrator,
|
||||
private val bookRepository: BookRepository
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ class BookController(
|
|||
} ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
|
||||
@PostMapping("api/v1/books/{bookId}/analyze")
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
@ResponseStatus(HttpStatus.ACCEPTED)
|
||||
fun analyze(@PathVariable bookId: Long) {
|
||||
bookRepository.findByIdOrNull(bookId)?.let { book ->
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import kotlin.streams.asSequence
|
|||
|
||||
@RestController
|
||||
@RequestMapping("api/v1/filesystem", produces = [MediaType.APPLICATION_JSON_VALUE])
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
class FileSystemController {
|
||||
|
||||
private val fs = FileSystems.getDefault()
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class LibraryController(
|
|||
}
|
||||
|
||||
@PostMapping("{libraryId}/scan")
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
@ResponseStatus(HttpStatus.ACCEPTED)
|
||||
fun scan(@PathVariable libraryId: Long) {
|
||||
libraryRepository.findByIdOrNull(libraryId)?.let { library ->
|
||||
|
|
@ -103,7 +103,7 @@ class LibraryController(
|
|||
}
|
||||
|
||||
@PostMapping("{libraryId}/analyze")
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
@ResponseStatus(HttpStatus.ACCEPTED)
|
||||
fun analyze(@PathVariable libraryId: Long) {
|
||||
libraryRepository.findByIdOrNull(libraryId)?.let { library ->
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ class SeriesController(
|
|||
}
|
||||
|
||||
@PostMapping("{seriesId}/analyze")
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
@ResponseStatus(HttpStatus.ACCEPTED)
|
||||
fun analyze(@PathVariable seriesId: Long) {
|
||||
seriesRepository.findByIdOrNull(seriesId)?.let { series ->
|
||||
|
|
@ -219,7 +219,7 @@ class SeriesController(
|
|||
}
|
||||
|
||||
@PatchMapping("{seriesId}/metadata")
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
fun updateMetadata(
|
||||
@PathVariable seriesId: Long,
|
||||
@RequestBody newMetadata: SeriesMetadataUpdateDto
|
||||
|
|
|
|||
Loading…
Reference in a new issue