in app/auth/BearerTokenAuth.scala [233:256]
def checkUserRoles(claimsSet: JWTClaimsSet): Either[LoginResultInvalid[String], LoginResultOK[JWTClaimsSet]] = {
(Option(claimsSet.getStringArrayClaim("roles")), Option(claimsSet.getStringClaim(isAdminClaimName())), Option(claimsSet.getStringClaim("multimedia_creator"))) match {
case (Some(roles), _, _) =>
if (roles.contains(isAdminClaimName()) || roles.contains("multimedia_creator")) {
Right(LoginResultOK(claimsSet))
} else {
Left(LoginResultInvalid("You do not have access to this system. Contact Multimediatech if you think this is an error."))
}
case (_, Some(_), _) =>
if(!claimsSet.getIsMMAdmin) {
Left(LoginResultInvalid("You do not have access to this system. Contact Multimediatech if you think this is an error."))
} else {
Right(LoginResultOK(claimsSet))
}
case (_, _, Some(_)) =>
if(!claimsSet.getIsMMCreator) {
Left(LoginResultInvalid("You do not have access to this system. Contact Multimediatech if you think this is an error."))
} else {
Right(LoginResultOK(claimsSet))
}
case (_, None, None) =>
Left(LoginResultInvalid("You do not have access to this system. Contact Multimediatech if you think this is an error."))
}
}