Avoid taking into account guest accounts flag (#13643)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d496e6a6a6
Коммит
97969a2904
@@ -96,7 +96,7 @@ func patchRole(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if (c.App.License() == nil || !*c.App.License().Features.GuestAccounts) && patch.Permissions != nil {
|
||||
if c.App.License() == nil && patch.Permissions != nil {
|
||||
if oldRole.Name == "system_guest" || oldRole.Name == "team_guest" || oldRole.Name == "channel_guest" {
|
||||
c.Err = model.NewAppError("Api4.PatchRoles", "api.roles.patch_roles.license.error", nil, "", http.StatusNotImplemented)
|
||||
return
|
||||
@@ -129,7 +129,7 @@ func patchRole(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
if c.App.License() != nil && *c.App.License().Features.GuestAccounts && (oldRole.Name == "system_guest" || oldRole.Name == "team_guest" || oldRole.Name == "channel_guest") && !*c.App.License().Features.GuestAccountsPermissions {
|
||||
if c.App.License() != nil && (oldRole.Name == "system_guest" || oldRole.Name == "team_guest" || oldRole.Name == "channel_guest") && !*c.App.License().Features.GuestAccountsPermissions {
|
||||
c.Err = model.NewAppError("Api4.PatchRoles", "api.roles.patch_roles.license.error", nil, "", http.StatusNotImplemented)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -977,7 +977,7 @@ func inviteUsersToTeam(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func inviteGuestsToChannels(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
if c.App.License() == nil || !*c.App.License().Features.GuestAccounts {
|
||||
if c.App.License() == nil {
|
||||
c.Err = model.NewAppError("Api4.InviteGuestsToChannels", "api.team.invate_guests_to_channels.license.error", nil, "", http.StatusNotImplemented)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user