feat(admin): 콘텐츠 관리자 읽기 권한을 확장한다
This commit is contained in:
@@ -13,10 +13,10 @@ import org.springframework.web.bind.annotation.RestController
|
||||
import org.springframework.web.multipart.MultipartFile
|
||||
|
||||
@RestController
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
@RequestMapping("/admin/audio-content")
|
||||
class AdminContentController(private val service: AdminContentService) {
|
||||
@GetMapping("/list")
|
||||
@PreAuthorize("hasAnyRole('ADMIN', 'CONTENT_MANAGER')")
|
||||
fun getAudioContentList(
|
||||
@RequestParam(value = "status", required = false) status: ContentReleaseStatus?,
|
||||
pageable: Pageable
|
||||
@@ -28,6 +28,7 @@ class AdminContentController(private val service: AdminContentService) {
|
||||
)
|
||||
|
||||
@GetMapping("/search")
|
||||
@PreAuthorize("hasAnyRole('ADMIN', 'CONTENT_MANAGER')")
|
||||
fun searchAudioContent(
|
||||
@RequestParam(value = "status", required = false) status: ContentReleaseStatus?,
|
||||
@RequestParam(value = "search_word") searchWord: String,
|
||||
@@ -41,12 +42,14 @@ class AdminContentController(private val service: AdminContentService) {
|
||||
)
|
||||
|
||||
@PutMapping(consumes = [MediaType.MULTIPART_FORM_DATA_VALUE])
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
fun modifyAudioContent(
|
||||
@RequestPart("request") requestString: String,
|
||||
@RequestPart("coverImage", required = false) coverImage: MultipartFile? = null
|
||||
) = ApiResponse.ok(service.updateAudioContent(coverImage, requestString))
|
||||
|
||||
@GetMapping("/main/tab")
|
||||
@PreAuthorize("hasAnyRole('ADMIN', 'CONTENT_MANAGER')")
|
||||
fun getContentMainTabList() = ApiResponse.ok(service.getContentMainTabList())
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController
|
||||
@RequestMapping("/menu")
|
||||
class MenuController(private val service: MenuService) {
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyRole('AGENT', 'ADMIN', 'CREATOR')")
|
||||
@PreAuthorize("hasAnyRole('AGENT', 'ADMIN', 'CREATOR', 'CONTENT_MANAGER')")
|
||||
fun getMenus(
|
||||
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
|
||||
) = run {
|
||||
|
||||
Reference in New Issue
Block a user