GetGroupIDs returns a slice containing the group ids of all the given groups.
(groups []Group)
| 20 | |
| 21 | // GetGroupIDs returns a slice containing the group ids of all the given groups. |
| 22 | func GetGroupIDs(groups []Group) []string { |
| 23 | if len(groups) == 0 { |
| 24 | // the user does not have any groups |
| 25 | return nil |
| 26 | } |
| 27 | |
| 28 | jwtGroups := make([]string, 0, len(groups)) |
| 29 | for _, g := range groups { |
| 30 | jwtGroups = append(jwtGroups, g.GroupID) |
| 31 | } |
| 32 | return jwtGroups |
| 33 | } |
| 34 | |
| 35 | var ( |
| 36 | OpRead = "Read" |
no outgoing calls