zitadel/internal/iam/model/iam_member.go
Fabi 62b654ea18
feat: iam members in admin api (#272)
* feat: iam members in admin api

* feat: add error id in translate error

* fix: resolve merge conflicts
2020-06-25 08:12:29 +02:00

19 lines
419 B
Go

package model
import es_models "github.com/caos/zitadel/internal/eventstore/models"
type IamMember struct {
es_models.ObjectRoot
UserID string
Roles []string
}
func NewIamMember(iamID, userID string) *IamMember {
return &IamMember{ObjectRoot: es_models.ObjectRoot{AggregateID: iamID}, UserID: userID}
}
func (i *IamMember) IsValid() bool {
return i.AggregateID != "" && i.UserID != "" && len(i.Roles) != 0
}