summaryrefslogtreecommitdiffstats
path: root/api/post.go
diff options
context:
space:
mode:
authorRachel Willmer <rachel@willmer.org>2016-11-17 19:05:53 +0000
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-17 14:05:53 -0500
commita25afb113489bcdd3fd07cb6dc4c18ae70662795 (patch)
treebab7e41eb37b30d1653fdcc70ba62277bf8e06a2 /api/post.go
parent6d2882f6e70bc1c8794e0193a574dfe254b57d79 (diff)
downloadchat-a25afb113489bcdd3fd07cb6dc4c18ae70662795.tar.gz
chat-a25afb113489bcdd3fd07cb6dc4c18ae70662795.tar.bz2
chat-a25afb113489bcdd3fd07cb6dc4c18ae70662795.zip
Fix SystemAdmin use of CreateAt in CreatePost API (#4349) (#4408)
Diffstat (limited to 'api/post.go')
-rw-r--r--api/post.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/api/post.go b/api/post.go
index f17df8831..bcbdd7760 100644
--- a/api/post.go
+++ b/api/post.go
@@ -132,7 +132,9 @@ func CreatePost(c *Context, post *model.Post, triggerWebhooks bool) (*model.Post
}
}
- post.CreateAt = 0
+ if post.CreateAt != 0 && !HasPermissionToContext(c, model.PERMISSION_MANAGE_SYSTEM) {
+ post.CreateAt = 0
+ }
post.Hashtags, _ = model.ParseHashtags(post.Message)