initial commit
This commit is contained in:
22
core/core.go
Normal file
22
core/core.go
Normal file
@ -0,0 +1,22 @@
|
||||
package core
|
||||
|
||||
type User struct {
|
||||
UUID string `json:"sub"`
|
||||
EmailVerified bool `json:"email_verified"`
|
||||
Name string `json:"name"`
|
||||
Groups []string `json:"groups"`
|
||||
PreferredUsername string `json:"preferred_username"`
|
||||
GivenName string `json:"given_name"`
|
||||
FamilyName string `json:"family_name"`
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
func (u User) HasGroupMembership(targetGroup string) bool {
|
||||
for _, group := range u.Groups {
|
||||
if group == targetGroup {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
Reference in New Issue
Block a user