diff --git a/keycloakclaims/utils.go b/keycloakclaims/utils.go new file mode 100644 index 0000000..1f95c50 --- /dev/null +++ b/keycloakclaims/utils.go @@ -0,0 +1,10 @@ +package keycloakclaims + +func RoleInRoles(role string, claims *Claims) bool { + for _, v := range claims.RealmAccess.Roles { + if role == v { + return true + } + } + return false +}