Skip to content

Commit

Permalink
2453 Added access in read mode to admin end-points for SPECIALIST role (
Browse files Browse the repository at this point in the history
  • Loading branch information
andrsam authored Aug 8, 2023
1 parent 6ea39e0 commit ee1c0a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/com/epam/brn/controller/CloudController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CloudController(

@GetMapping("/upload")
@Operation(summary = "Get cloud upload form")
@RolesAllowed(BrnRole.ADMIN)
@RolesAllowed(BrnRole.ADMIN, BrnRole.SPECIALIST)
@Throws(Exception::class)
fun signatureForClientDirectUpload(@RequestParam filePath: String?): ResponseEntity<BrnResponse<Map<String, Any>>> {
if (filePath.isNullOrEmpty())
Expand All @@ -58,7 +58,7 @@ class CloudController(

@GetMapping("/folders")
@Operation(summary = "Get cloud folder structure")
@RolesAllowed(BrnRole.ADMIN)
@RolesAllowed(BrnRole.ADMIN, BrnRole.SPECIALIST)
@Throws(Exception::class)
fun listBucket(): ResponseEntity<BrnResponse<List<String>>> =
ResponseEntity.ok(BrnResponse(cloudService.getStorageFolders()))
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/com/epam/brn/controller/ExerciseController.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.epam.brn.controller

import com.epam.brn.service.RoleService
import com.epam.brn.dto.ExerciseDto
import com.epam.brn.dto.request.ExerciseRequest
import com.epam.brn.dto.request.exercise.ExerciseCreateDto
import com.epam.brn.dto.response.ExerciseWithWordsResponse
import com.epam.brn.dto.response.BrnResponse
import com.epam.brn.dto.response.ExerciseWithWordsResponse
import com.epam.brn.enums.BrnRole
import com.epam.brn.service.ExerciseService
import com.epam.brn.service.RoleService
import com.epam.brn.upload.CsvUploadService
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.Parameter
Expand Down Expand Up @@ -75,7 +75,7 @@ class ExerciseController(

@GetMapping(value = ["/byWord"])
@Operation(summary = "Get exercises containing specified word")
@RolesAllowed(BrnRole.ADMIN)
@RolesAllowed(BrnRole.ADMIN, BrnRole.SPECIALIST)
fun getExercisesByWord(
@RequestParam(
value = "word",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.epam.brn.controller

import com.epam.brn.dto.HeadphonesDto
import com.epam.brn.dto.UserAccountDto
import com.epam.brn.dto.request.UserAccountChangeRequest
import com.epam.brn.dto.response.BrnResponse
import com.epam.brn.dto.UserAccountDto
import com.epam.brn.enums.BrnRole
import com.epam.brn.service.DoctorService
import com.epam.brn.service.UserAccountService
Expand Down Expand Up @@ -39,7 +39,7 @@ class UserDetailController(
) {
@GetMapping
@Operation(summary = "Get all users with/without analytic data")
@RolesAllowed(BrnRole.ADMIN)
@RolesAllowed(BrnRole.ADMIN, BrnRole.SPECIALIST)
fun getUsers(
@RequestParam("withAnalytics", defaultValue = "false") withAnalytics: Boolean,
@RequestParam("role", defaultValue = "USER") role: String,
Expand All @@ -52,7 +52,7 @@ class UserDetailController(

@GetMapping(value = ["/{userId}"])
@Operation(summary = "Get user by id")
@RolesAllowed(BrnRole.ADMIN)
@RolesAllowed(BrnRole.ADMIN, BrnRole.SPECIALIST)
fun findUserById(@PathVariable("userId") id: Long): ResponseEntity<BrnResponse<List<UserAccountDto>>> {
return ResponseEntity.ok()
.body(BrnResponse(data = listOf(userAccountService.findUserDtoById(id))))
Expand Down Expand Up @@ -102,7 +102,7 @@ class UserDetailController(

@GetMapping(value = ["/{userId}/headphones"])
@Operation(summary = "Get all user's headphones")
@RolesAllowed(BrnRole.ADMIN)
@RolesAllowed(BrnRole.ADMIN, BrnRole.SPECIALIST)
fun getAllHeadphonesForUser(
@PathVariable("userId", required = true) userId: Long
) = ResponseEntity
Expand Down

0 comments on commit ee1c0a7

Please sign in to comment.