Avoid taking into account guest accounts flag (#13643)

Этот коммит содержится в:
Miguel de la Cruz
2020-01-21 17:29:54 +01:00
коммит произвёл GitHub
родитель d496e6a6a6
Коммит 97969a2904
3 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@@ -104,7 +104,7 @@ func createUser(c *Context, w http.ResponseWriter, r *http.Request) {
}
if token.Type == app.TOKEN_TYPE_GUEST_INVITATION {
if c.App.License() == nil || !*c.App.License().Features.GuestAccounts {
if c.App.License() == nil {
c.Err = model.NewAppError("CreateUserWithToken", "api.user.create_user.guest_accounts.license.app_error", nil, "", http.StatusBadRequest)
return
}
@@ -1382,7 +1382,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
}
if user.IsGuest() {
if c.App.License() == nil || !*c.App.License().Features.GuestAccounts {
if c.App.License() == nil {
c.Err = model.NewAppError("login", "api.user.login.guest_accounts.license.error", nil, "", http.StatusUnauthorized)
return
}
@@ -1966,7 +1966,7 @@ func promoteGuestToUser(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if c.App.License() == nil || !*c.App.License().Features.GuestAccounts {
if c.App.License() == nil {
c.Err = model.NewAppError("Api4.promoteGuestToUser", "api.team.promote_guest_to_user.license.error", nil, "", http.StatusNotImplemented)
return
}
@@ -2006,7 +2006,7 @@ func demoteUserToGuest(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if c.App.License() == nil || !*c.App.License().Features.GuestAccounts {
if c.App.License() == nil {
c.Err = model.NewAppError("Api4.demoteUserToGuest", "api.team.demote_user_to_guest.license.error", nil, "", http.StatusNotImplemented)
return
}