v8.0 module release (#22975)
https://mattermost.atlassian.net/browse/MM-52079 ```release-note We upgrade the module version to 8.0. The new module path is github.com/mattermost-server/server/v8. ``` Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
831ea38f7e
Коммит
b200a07881
48
server/model/switch_request.go
Обычный файл
48
server/model/switch_request.go
Обычный файл
@@ -0,0 +1,48 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
package model
|
||||
|
||||
type SwitchRequest struct {
|
||||
CurrentService string `json:"current_service"`
|
||||
NewService string `json:"new_service"`
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
NewPassword string `json:"new_password"`
|
||||
MfaCode string `json:"mfa_code"`
|
||||
LdapLoginId string `json:"ldap_id"`
|
||||
}
|
||||
|
||||
func (o *SwitchRequest) Auditable() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"current_service": o.CurrentService,
|
||||
"new_service": o.NewService,
|
||||
"email": o.Email,
|
||||
"ldap_login_id": o.LdapLoginId,
|
||||
}
|
||||
}
|
||||
|
||||
func (o *SwitchRequest) EmailToOAuth() bool {
|
||||
return o.CurrentService == UserAuthServiceEmail &&
|
||||
(o.NewService == UserAuthServiceSaml ||
|
||||
o.NewService == UserAuthServiceGitlab ||
|
||||
o.NewService == ServiceGoogle ||
|
||||
o.NewService == ServiceOffice365 ||
|
||||
o.NewService == ServiceOpenid)
|
||||
}
|
||||
|
||||
func (o *SwitchRequest) OAuthToEmail() bool {
|
||||
return (o.CurrentService == UserAuthServiceSaml ||
|
||||
o.CurrentService == UserAuthServiceGitlab ||
|
||||
o.CurrentService == ServiceGoogle ||
|
||||
o.CurrentService == ServiceOffice365 ||
|
||||
o.CurrentService == ServiceOpenid) && o.NewService == UserAuthServiceEmail
|
||||
}
|
||||
|
||||
func (o *SwitchRequest) EmailToLdap() bool {
|
||||
return o.CurrentService == UserAuthServiceEmail && o.NewService == UserAuthServiceLdap
|
||||
}
|
||||
|
||||
func (o *SwitchRequest) LdapToEmail() bool {
|
||||
return o.CurrentService == UserAuthServiceLdap && o.NewService == UserAuthServiceEmail
|
||||
}
|
||||
Ссылка в новой задаче
Block a user