lavender/server/roles.go

17 lines
261 B
Go
Raw Normal View History

2024-02-07 01:18:17 +00:00
package server
2024-09-02 22:54:03 +01:00
func HasRole(roles []string, test string) bool {
for _, role := range roles {
if role == test {
2024-02-07 01:18:17 +00:00
return true
}
}
return false
}
2024-09-02 22:54:03 +01:00
func ForEachRole(roles []string, next func(role string)) {
for _, role := range roles {
next(role)
}
}