summaryrefslogtreecommitdiffstats
path: root/api/post.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-03-31 12:25:39 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2017-03-31 12:25:39 -0400
commitaba07e5cb9e9b5668c4fb94bfe9f096a26538528 (patch)
tree4a7348f71da063051cd77677cd37313760e9b9b8 /api/post.go
parent84826bf5632a9afb2c621b8cbcf935ad03943997 (diff)
downloadchat-aba07e5cb9e9b5668c4fb94bfe9f096a26538528.tar.gz
chat-aba07e5cb9e9b5668c4fb94bfe9f096a26538528.tar.bz2
chat-aba07e5cb9e9b5668c4fb94bfe9f096a26538528.zip
PLT-5483 Fix bug where flagged posts endpoint returned posts on other teams (#5765)
* Fix bug where flagged posts endpoint returned posts on other teams * Include flagged posts from DMs/GMs
Diffstat (limited to 'api/post.go')
-rw-r--r--api/post.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/api/post.go b/api/post.go
index afe60144d..b4c34bca2 100644
--- a/api/post.go
+++ b/api/post.go
@@ -161,7 +161,12 @@ func getFlaggedPosts(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if posts, err := app.GetFlaggedPosts(c.Session.UserId, offset, limit); err != nil {
+ if !app.SessionHasPermissionToTeam(c.Session, c.TeamId, model.PERMISSION_VIEW_TEAM) {
+ c.SetPermissionError(model.PERMISSION_VIEW_TEAM)
+ return
+ }
+
+ if posts, err := app.GetFlaggedPostsForTeam(c.Session.UserId, c.TeamId, offset, limit); err != nil {
c.Err = err
return
} else {