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