summaryrefslogtreecommitdiffstats
path: root/app/post.go
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-02-07 18:05:23 +0100
committerJesús Espino <jespinog@gmail.com>2018-02-07 18:05:23 +0100
commita04b02081a77497ecfc7a5ae9ffb0ca28404dd0e (patch)
tree985cb699d278f68522b08b60b1e7b84e0bd243fc /app/post.go
parent7941c30117efe1b957ac0458c2f0479e3824196d (diff)
parent7bd298ceaa24c0721e0acd65692cb2d1ca4983f3 (diff)
downloadchat-a04b02081a77497ecfc7a5ae9ffb0ca28404dd0e.tar.gz
chat-a04b02081a77497ecfc7a5ae9ffb0ca28404dd0e.tar.bz2
chat-a04b02081a77497ecfc7a5ae9ffb0ca28404dd0e.zip
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1
Diffstat (limited to 'app/post.go')
-rw-r--r--app/post.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/post.go b/app/post.go
index 9e32badad..01abb21cf 100644
--- a/app/post.go
+++ b/app/post.go
@@ -124,7 +124,7 @@ func (a *App) CreatePost(post *model.Post, channel *model.Channel, triggerWebhoo
user = result.Data.(*model.User)
}
- if utils.IsLicensed() && *a.Config().TeamSettings.ExperimentalTownSquareIsReadOnly &&
+ if a.License() != nil && *a.Config().TeamSettings.ExperimentalTownSquareIsReadOnly &&
!post.IsSystemMessage() &&
channel.Name == model.DEFAULT_CHANNEL &&
!a.RolesGrantPermission(user.GetRoles(), model.PERMISSION_MANAGE_SYSTEM.Id) {
@@ -332,7 +332,7 @@ func (a *App) UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model
} else {
oldPost = result.Data.(*model.PostList).Posts[post.Id]
- if utils.IsLicensed() {
+ if a.License() != nil {
if *a.Config().ServiceSettings.AllowEditPost == model.ALLOW_EDIT_POST_NEVER && post.Message != oldPost.Message {
err := model.NewAppError("UpdatePost", "api.post.update_post.permissions_denied.app_error", nil, "", http.StatusForbidden)
return nil, err
@@ -354,7 +354,7 @@ func (a *App) UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model
return nil, err
}
- if utils.IsLicensed() {
+ if a.License() != nil {
if *a.Config().ServiceSettings.AllowEditPost == model.ALLOW_EDIT_POST_TIME_LIMIT && model.GetMillis() > oldPost.CreateAt+int64(*a.Config().ServiceSettings.PostEditTimeLimit*1000) && post.Message != oldPost.Message {
err := model.NewAppError("UpdatePost", "api.post.update_post.permissions_time_limit.app_error", map[string]interface{}{"timeLimit": *a.Config().ServiceSettings.PostEditTimeLimit}, "", http.StatusBadRequest)
return nil, err
@@ -613,7 +613,7 @@ func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOr
paramsList := model.ParseSearchParams(terms)
esInterface := a.Elasticsearch
- if esInterface != nil && *a.Config().ElasticsearchSettings.EnableSearching && utils.IsLicensed() && *utils.License().Features.Elasticsearch {
+ if license := a.License(); esInterface != nil && *a.Config().ElasticsearchSettings.EnableSearching && license != nil && *license.Features.Elasticsearch {
finalParamsList := []*model.SearchParams{}
for _, params := range paramsList {