Skip to content

Commit

Permalink
Show boards with syntetic membership (mattermost-community#3557)
Browse files Browse the repository at this point in the history
  • Loading branch information
jespino authored Aug 5, 2022
1 parent 08dd39d commit 287a026
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,18 @@ func (s *MattermostAuthLayer) SearchBoardsForUser(term, userID string) ([]*model
From(s.tablePrefix + "boards as b").
LeftJoin(s.tablePrefix + "board_members as bm on b.id=bm.board_id").
LeftJoin("TeamMembers as tm on tm.teamid=b.team_id").
LeftJoin("ChannelMembers as cm on cm.channelId=b.channel_id").
Where(sq.Eq{"b.is_template": false}).
Where(sq.Eq{"tm.userID": userID}).
Where(sq.Eq{"tm.deleteAt": 0}).
Where(sq.Or{
sq.Eq{"b.type": model.BoardTypeOpen},
sq.And{
sq.Eq{"b.type": model.BoardTypePrivate},
sq.Eq{"bm.user_id": userID},
sq.Or{
sq.Eq{"bm.user_id": userID},
sq.Eq{"cm.userId": userID},
},
},
})

Expand Down

0 comments on commit 287a026

Please sign in to comment.