MM-57873 Check user visibility when accepting channel invites for DMs (#27331)

* check user visibility when accepting channel invites for DMs

* stronger visibility checking for DM users

* check for correct remoteid for remote user in DM invite

* fix unit test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Doug Lauder
2024-06-13 05:40:31 -04:00
коммит произвёл GitHub
родитель 9733694854
Коммит bf8ddb4bdc
5 изменённых файлов: 167 добавлений и 52 удалений

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

@@ -55,6 +55,7 @@ type AppIface interface {
SendEphemeralPost(c request.CTX, userId string, post *model.Post) *model.Post
CreateChannelWithUser(c request.CTX, channel *model.Channel, userId string) (*model.Channel, *model.AppError)
GetOrCreateDirectChannel(c request.CTX, userId, otherUserId string, channelOptions ...model.ChannelOption) (*model.Channel, *model.AppError)
UserCanSeeOtherUser(c request.CTX, userID string, otherUserId string) (bool, *model.AppError)
AddUserToChannel(c request.CTX, user *model.User, channel *model.Channel, skipTeamMemberIntegrityCheck bool) (*model.ChannelMember, *model.AppError)
AddUserToTeamByTeamId(c request.CTX, teamId string, user *model.User) *model.AppError
PermanentDeleteChannel(c request.CTX, channel *model.Channel) *model.AppError