Skip to content

Commit

Permalink
chore: adding access check on getOppgave
Browse files Browse the repository at this point in the history
  • Loading branch information
jaflaten committed Dec 2, 2024
1 parent e26c3c4 commit fe30817
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import org.springframework.http.client.ClientHttpRequestExecution
import org.springframework.http.client.ClientHttpRequestInterceptor
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory
import org.springframework.security.core.context.ReactiveSecurityContextHolder
import org.springframework.security.core.context.SecurityContextHolder
import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken
import org.springframework.stereotype.Component
import org.springframework.web.client.RestTemplate
Expand All @@ -30,8 +29,8 @@ class SykDigTokenResolver : JwtBearerTokenResolver {
val log = applog()

override fun token(): String? {
val autentication = ReactiveSecurityContextHolder.getContext().block()?.authentication as JwtAuthenticationToken
return autentication.token.tokenValue
val authentication = ReactiveSecurityContextHolder.getContext().block()?.authentication as JwtAuthenticationToken
return authentication.token.tokenValue
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class NasjonalOppgaveController(
}

@GetMapping("/oppgave/{oppgaveid}")
@PreAuthorize("@oppgaveSecurityService.hasAccessToNasjonalOppgave(#oppgaveId)")
@ResponseBody
suspend fun getPapirsykmeldingManuellOppgave(
@PathVariable oppgaveid: String,
Expand Down

0 comments on commit fe30817

Please sign in to comment.