Files
zitadel/internal/domain/organization_settings.go
Stefan Benz 6d98b33c56 feat: organization settings for user uniqueness (#10246)
# Which Problems Are Solved

Currently the username uniqueness is on instance level, we want to
achieve a way to set it at organization level.

# How the Problems Are Solved

Addition of endpoints and a resource on organization level, where this
setting can be managed. If nothing it set, the uniqueness is expected to
be at instance level, where only users with instance permissions should
be able to change this setting.

# Additional Changes

None

# Additional Context

Includes #10086
Closes #9964 

---------

Co-authored-by: Marco A. <marco@zitadel.com>
2025-07-29 15:56:21 +02:00

20 lines
499 B
Go

package domain
type OrganizationSettingsState int32
const (
OrganizationSettingsStateUnspecified OrganizationSettingsState = iota
OrganizationSettingsStateActive
OrganizationSettingsStateRemoved
organizationSettingsStateCount
)
func (c OrganizationSettingsState) Valid() bool {
return c >= 0 && c < organizationSettingsStateCount
}
func (s OrganizationSettingsState) Exists() bool {
return s.Valid() && s != OrganizationSettingsStateUnspecified && s != OrganizationSettingsStateRemoved
}