2021-01-12 11:59:51 +00:00
|
|
|
package domain
|
|
|
|
|
|
|
|
import (
|
2021-02-23 14:13:04 +00:00
|
|
|
"github.com/caos/zitadel/internal/eventstore/v1/models"
|
2021-01-12 11:59:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Project struct {
|
|
|
|
models.ObjectRoot
|
|
|
|
|
2021-08-24 06:34:10 +00:00
|
|
|
State ProjectState
|
|
|
|
Name string
|
|
|
|
ProjectRoleAssertion bool
|
|
|
|
ProjectRoleCheck bool
|
|
|
|
HasProjectCheck bool
|
|
|
|
PrivateLabelingSetting PrivateLabelingSetting
|
2021-01-12 11:59:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ProjectState int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
ProjectStateUnspecified ProjectState = iota
|
|
|
|
ProjectStateActive
|
|
|
|
ProjectStateInactive
|
|
|
|
ProjectStateRemoved
|
2022-04-12 14:20:17 +00:00
|
|
|
|
|
|
|
projectStateMax
|
2021-01-12 11:59:51 +00:00
|
|
|
)
|
|
|
|
|
2022-04-12 14:20:17 +00:00
|
|
|
func (s ProjectState) Valid() bool {
|
|
|
|
return s > ProjectStateUnspecified && s < projectStateMax
|
|
|
|
}
|
|
|
|
|
2021-08-24 06:34:10 +00:00
|
|
|
type PrivateLabelingSetting int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
PrivateLabelingSettingUnspecified PrivateLabelingSetting = iota
|
|
|
|
PrivateLabelingSettingEnforceProjectResourceOwnerPolicy
|
|
|
|
PrivateLabelingSettingAllowLoginUserResourceOwnerPolicy
|
2022-03-28 08:05:09 +00:00
|
|
|
|
|
|
|
privateLabelingSettingMax
|
2021-08-24 06:34:10 +00:00
|
|
|
)
|
|
|
|
|
2022-03-28 08:05:09 +00:00
|
|
|
func (s PrivateLabelingSetting) Valid() bool {
|
|
|
|
return s >= PrivateLabelingSettingUnspecified && s < privateLabelingSettingMax
|
|
|
|
}
|
|
|
|
|
2021-01-12 11:59:51 +00:00
|
|
|
func (o *Project) IsValid() bool {
|
|
|
|
return o.Name != ""
|
|
|
|
}
|