mirror of
https://github.com/prymitive/karma
synced 2026-05-21 04:33:07 +00:00
17 lines
372 B
Go
17 lines
372 B
Go
package main
|
|
|
|
import (
|
|
"github.com/prymitive/karma/internal/config"
|
|
"github.com/prymitive/karma/internal/slices"
|
|
)
|
|
|
|
func userGroups(username string) []string {
|
|
groups := []string{}
|
|
for _, authGroup := range config.Config.Authorization.Groups {
|
|
if slices.StringInSlice(authGroup.Members, username) {
|
|
groups = append(groups, authGroup.Name)
|
|
}
|
|
}
|
|
return groups
|
|
}
|