MM-11348: Add telemetry for advanced permissions. (#9249)

Этот коммит содержится в:
George Goldberg
2018-08-23 11:48:57 +01:00
коммит произвёл GitHub
родитель dc4d009c78
Коммит 8bbee74ed8
6 изменённых файлов: 226 добавлений и 32 удалений

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

@@ -913,3 +913,14 @@ func (s SqlTeamStore) ClearAllCustomRoleAssignments() store.StoreChannel {
}
})
}
func (s SqlTeamStore) AnalyticsGetTeamCountForScheme(schemeId string) store.StoreChannel {
return store.Do(func(result *store.StoreResult) {
count, err := s.GetReplica().SelectInt("SELECT count(*) FROM Teams WHERE SchemeId = :SchemeId AND DeleteAt = 0", map[string]interface{}{"SchemeId": schemeId})
if err != nil {
result.Err = model.NewAppError("SqlTeamStore.AnalyticsGetTeamCountForScheme", "store.sql_team.analytics_get_team_count_for_scheme.app_error", nil, "schemeId="+schemeId+" "+err.Error(), http.StatusInternalServerError)
return
}
result.Data = count
})
}