added RoleInRoles utility function
This commit is contained in:
parent
611f911b5f
commit
7bdfd541f1
10
keycloakclaims/utils.go
Normal file
10
keycloakclaims/utils.go
Normal 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
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user