Revert "MM-14845: Fix Update and Patch channel for private channels. (#10539)" (#10599)

This reverts commit 0bef611f7a.
Этот коммит содержится в:
George Goldberg
2019-04-26 11:07:53 +01:00
коммит произвёл GitHub
родитель dc0441e28c
Коммит 3989b90a91
2 изменённых файлов: 1 добавлений и 24 удалений

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

@@ -120,12 +120,6 @@ func updateChannel(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
// Since the `team_user` role can have PERMISSION_MANAGE_PRIVATE_CHANNEL_PROPERTIES out of the box, we must additionally check membership for private channels.
if _, memberErr := c.App.GetChannelMember(channel.Id, c.App.Session.UserId); memberErr != nil {
c.Err = model.NewAppError("updateChannel", "api.channel.patch_update_channel.forbidden.app_error", nil, "", http.StatusForbidden)
return
}
case model.CHANNEL_GROUP, model.CHANNEL_DIRECT:
// Modifying the header is not linked to any specific permission for group/dm channels, so just check for membership.
if _, err := c.App.GetChannelMember(channel.Id, c.App.Session.UserId); err != nil {
@@ -263,12 +257,6 @@ func patchChannel(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
// Since the `team_user` role can have PERMISSION_MANAGE_PRIVATE_CHANNEL_PROPERTIES out of the box, we must additionally check membership for private channels.
if _, memberErr := c.App.GetChannelMember(c.Params.ChannelId, c.App.Session.UserId); memberErr != nil {
c.Err = model.NewAppError("patchChannel", "api.channel.patch_update_channel.forbidden.app_error", nil, "", http.StatusForbidden)
return
}
case model.CHANNEL_GROUP, model.CHANNEL_DIRECT:
// Modifying the header is not linked to any specific permission for group/dm channels, so just check for membership.
if _, err = c.App.GetChannelMember(c.Params.ChannelId, c.App.Session.UserId); err != nil {