added RoleInRoles utility function
This commit is contained in:
parent
611f911b5f
commit
7bdfd541f1
1 changed files with 10 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue