fix: user with state initial can only be deleted not deactivated (#3110)

This commit is contained in:
Fabi
2022-01-25 11:54:36 +01:00
committed by GitHub
parent 159d82ad8e
commit ce53fe7814
5 changed files with 10 additions and 0 deletions

View File

@@ -140,6 +140,10 @@ func isUserStateInactive(state domain.UserState) bool {
return hasUserState(state, domain.UserStateInactive)
}
func isUserStateInitial(state domain.UserState) bool {
return hasUserState(state, domain.UserStateInitial)
}
func hasUserState(check domain.UserState, states ...domain.UserState) bool {
for _, state := range states {
if check == state {