* [MM-42270] - Fix MM-42270

* clean test code

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Allan Guwatudde
2022-03-07 18:58:43 +03:00
коммит произвёл GitHub
родитель a2fc602bc2
Коммит f6fef9362b
2 изменённых файлов: 19 добавлений и 0 удалений

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

@@ -76,6 +76,11 @@ func generateSupportPacket(c *Context, w http.ResponseWriter, r *http.Request) {
const FileMime = "application/zip"
const OutputDirectory = "support_packet"
if *c.App.Config().ExperimentalSettings.RestrictSystemAdmin {
c.Err = model.NewAppError("generateSupportPacket", "api.restricted_system_admin", nil, "", http.StatusForbidden)
return
}
// Checking to see if the user is a admin of any sort or not
// If they are a admin, they should theoretically have access to one or more of the system console read permissions
if !c.App.SessionHasPermissionToAny(*c.AppContext.Session(), model.SysconsoleReadPermissions) {