[MM-56174] Account for archived channels in channel member for post permission check (#25837)

* [MM-56174] Account for archived channels in channel member for post permission check

* Add tests
Этот коммит содержится в:
Devin Binnie
2024-01-10 15:50:00 -05:00
коммит произвёл GitHub
родитель 1d108f0d9f
Коммит 43cca04f04
9 изменённых файлов: 129 добавлений и 21 удалений

Просмотреть файл

@@ -1445,10 +1445,10 @@ func (s *TimerLayerChannelStore) GetMemberCountsByGroup(ctx context.Context, cha
return result, err
}
func (s *TimerLayerChannelStore) GetMemberForPost(postID string, userID string) (*model.ChannelMember, error) {
func (s *TimerLayerChannelStore) GetMemberForPost(postID string, userID string, includeArchivedChannels bool) (*model.ChannelMember, error) {
start := time.Now()
result, err := s.ChannelStore.GetMemberForPost(postID, userID)
result, err := s.ChannelStore.GetMemberForPost(postID, userID, includeArchivedChannels)
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {