[release-10.11] Restrict group_constrained to channels that support group sync (#36916)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
56098dd6f0
Коммит
beaa59db54
@@ -345,6 +345,11 @@ func patchChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
model.AddEventParameterAuditableToAuditRec(auditRec, "channel", patch)
|
||||
auditRec.AddEventPriorState(oldChannel)
|
||||
|
||||
if patch.GroupConstrained != nil && !oldChannel.SupportsGroupSync() {
|
||||
c.Err = model.NewAppError("patchChannel", "api.channel.patch_update_channel.group_constrained_not_allowed.app_error", nil, "", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
switch oldChannel.Type {
|
||||
case model.ChannelTypeOpen:
|
||||
if ok, _ := c.App.SessionHasPermissionToChannel(c.AppContext, *c.AppContext.Session(), c.Params.ChannelId, model.PermissionManagePublicChannelProperties); !ok {
|
||||
|
||||
Ссылка в новой задаче
Block a user