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.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d7ee3553fa
Коммит
e62471dff6
@@ -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)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user