diff --git a/mattermost-plugin/server/manifest.go b/mattermost-plugin/server/manifest.go index 24a40fda5..481a57c9f 100644 --- a/mattermost-plugin/server/manifest.go +++ b/mattermost-plugin/server/manifest.go @@ -45,7 +45,8 @@ const manifestStr = ` "type": "bool", "help_text": "This allows board editors to share boards that can be accessed by anyone with the link.", "placeholder": "", - "default": false + "default": false, + "hosting": "" } ] } diff --git a/server/services/store/mattermostauthlayer/mattermostauthlayer.go b/server/services/store/mattermostauthlayer/mattermostauthlayer.go index 8a012e45a..cf3006e8b 100644 --- a/server/services/store/mattermostauthlayer/mattermostauthlayer.go +++ b/server/services/store/mattermostauthlayer/mattermostauthlayer.go @@ -984,31 +984,26 @@ func (s *MattermostAuthLayer) GetMembersForBoard(boardID string) ([]*model.Board } func (s *MattermostAuthLayer) GetBoardsForUserAndTeam(userID, teamID string, includePublicBoards bool) ([]*model.Board, error) { + if includePublicBoards { + boards, err := s.SearchBoardsForUserInTeam(teamID, "", userID) + if err != nil { + return nil, err + } + return boards, nil + } + + // retrieve only direct memberships for user + // this is usually done for guests. members, err := s.GetMembersForUser(userID) if err != nil { return nil, err } - boardIDs := []string{} for _, m := range members { boardIDs = append(boardIDs, m.BoardID) } - if includePublicBoards { - var boards []*model.Board - boards, err = s.SearchBoardsForUserInTeam(teamID, "", userID) - if err != nil { - return nil, err - } - for _, b := range boards { - boardIDs = append(boardIDs, b.ID) - } - } - boards, err := s.Store.GetBoardsInTeamByIds(boardIDs, teamID) - // ToDo: check if the query is being used appropriately from the - // interface, as we're getting ID sets on request that - // return partial results that seem to be valid if model.IsErrNotFound(err) { if boards == nil { boards = []*model.Board{}