ActiveAnno

Web-based responsive document annotation tool

View the Project on GitHub MaxMello/ActiveAnno

activeannoservice / common / io.ktor.util.pipeline.PipelineContext / protectedByRole

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