diff --git a/api4/role.go b/api4/role.go index 7ef0b5ef20..85b4c2fc13 100644 --- a/api4/role.go +++ b/api4/role.go @@ -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 } diff --git a/api4/team.go b/api4/team.go index 8cc73beaa4..e08bd5f718 100644 --- a/api4/team.go +++ b/api4/team.go @@ -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 } diff --git a/api4/user.go b/api4/user.go index 60c8cb412d..e0828a2947 100644 --- a/api4/user.go +++ b/api4/user.go @@ -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 }