diff --git a/api4/system.go b/api4/system.go index 398913c27d..d401ab0256 100644 --- a/api4/system.go +++ b/api4/system.go @@ -81,10 +81,9 @@ func generateSupportPacket(c *Context, w http.ResponseWriter, r *http.Request) { 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) { - c.SetPermissionError(model.SysconsoleReadPermissions...) + // Support packet generation is limited to system admins (MM-42271). + if !c.App.SessionHasPermissionTo(*c.AppContext.Session(), model.PermissionManageSystem) { + c.SetPermissionError(model.PermissionManageSystem) return } diff --git a/api4/system_test.go b/api4/system_test.go index aeddc477c6..e3fbcbd366 100644 --- a/api4/system_test.go +++ b/api4/system_test.go @@ -222,6 +222,12 @@ func TestGenerateSupportPacket(t *testing.T) { CheckForbiddenStatus(t, resp) }) + t.Run("As a system role, not system admin", func(t *testing.T) { + _, resp, err := th.SystemManagerClient.GenerateSupportPacket() + require.Error(t, err) + CheckForbiddenStatus(t, resp) + }) + t.Run("As a Regular User", func(t *testing.T) { _, resp, err := th.Client.GenerateSupportPacket() require.Error(t, err)