mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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
This commit is contained in:
committed by
Harrison Healey
parent
84826bf563
commit
aba07e5cb9
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user