added RoleInRoles utility function

This commit is contained in:
Darko Luketic 2021-11-28 16:25:58 +01:00
parent 611f911b5f
commit 7bdfd541f1

10
keycloakclaims/utils.go Normal file
View File

@ -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
}