[release-10.11] Restrict group_constrained to channels that support group sync (#36916)

Automatic Merge
Этот коммит содержится в:
Maria A Nunez
2026-06-05 03:29:59 -04:00
коммит произвёл GitHub
родитель 56098dd6f0
Коммит beaa59db54
6 изменённых файлов: 95 добавлений и 0 удалений

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

@@ -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 {