[MM-42068] Add check to stop custom groups linking to teams and channels (#19633)

* tools updates

* Revert "tools updates"

This reverts commit 6293297b55803c5a263e200ebd80192899666ae9.

* stop custom groups linking to teams and channels

* updating test and changing logic

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
Этот коммит содержится в:
Ben Cooke
2022-02-28 15:06:26 -05:00
коммит произвёл GitHub
родитель f7504037fe
Коммит cc900149c6
2 изменённых файлов: 39 добавлений и 0 удалений

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

@@ -297,6 +297,17 @@ func linkGroupSyncable(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
group, groupErr := c.App.GetGroup(c.Params.GroupId, nil)
if groupErr != nil {
c.Err = groupErr
return
}
if group.Source != model.GroupSourceLdap {
c.Err = model.NewAppError("Api4.linkGroupSyncable", "app.group.crud_permission", nil, "", http.StatusBadRequest)
return
}
auditRec := c.MakeAuditRecord("linkGroupSyncable", audit.Fail)
defer c.LogAuditRec(auditRec)
auditRec.AddMeta("group_id", c.Params.GroupId)