Web-based responsive document annotation tool
activeannoservice / common / io.ktor.util.pipeline.PipelineContext / protectedByRole
suspend fun PipelineContext<
Unit
, ApplicationCall>.protectedByRole(requiredRoles:
List
<
String
>, onlyOneMustMatch:
Boolean
= false, block: suspend () ->
Unit
):
Unit
Higher order function that will check for authorization by checking the JWT roles against a list of required roles. If only one role must match, use the onlyOneMustMatch parameter to true