mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-18 13:57:32 +00:00
19 lines
427 B
Go
19 lines
427 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(projectID, userID string) *IamMember {
|
||
|
return &IamMember{ObjectRoot: es_models.ObjectRoot{AggregateID: projectID}, UserID: userID}
|
||
|
}
|
||
|
|
||
|
func (i *IamMember) IsValid() bool {
|
||
|
return i.AggregateID != "" && i.UserID != "" && len(i.Roles) != 0
|
||
|
}
|