MM-18816 Adding ability to add users as another user to the plugin API. (#12562)

* Adding ability to add users as anouther user to the plugin API.

* Documentation feedback.
Этот коммит содержится в:
Christopher Speller
2019-10-17 16:11:26 -07:00
коммит произвёл GitHub
родитель d7ee3553fa
Коммит e62471dff6
5 изменённых файлов: 87 добавлений и 1 удалений

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

@@ -406,6 +406,17 @@ func (api *PluginAPI) AddChannelMember(channelId, userId string) (*model.Channel
return api.app.AddChannelMember(userId, channel, userRequestorId, postRootId)
}
func (api *PluginAPI) AddUserToChannel(channelId, userId, asUserId string) (*model.ChannelMember, *model.AppError) {
postRootId := ""
channel, err := api.GetChannel(channelId)
if err != nil {
return nil, err
}
return api.app.AddChannelMember(userId, channel, asUserId, postRootId)
}
func (api *PluginAPI) GetChannelMember(channelId, userId string) (*model.ChannelMember, *model.AppError) {
return api.app.GetChannelMember(channelId, userId)
}