func eventBlockList(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	if !permission.Check(t, permission.PermEventBlockRead) {
		return permission.ErrUnauthorized
	}
	var active *bool
	if activeStr := InputValue(r, "active"); activeStr != "" {
		b, _ := strconv.ParseBool(activeStr)
		active = &b
	}
	blocks, err := event.ListBlocks(active)
	if err != nil {
		return err
	}
	if len(blocks) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	w.Header().Add("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(blocks)
}
func eventBlockList(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	if !permission.Check(t, permission.PermEventBlockRead) {
		return permission.ErrUnauthorized
	}
	var active *bool
	if activeStr := InputValue(r, "active"); activeStr != "" {
		b, _ := strconv.ParseBool(activeStr)
		active = &b
	}
	blocks, err := event.ListBlocks(active)
	if err != nil {
		return err
	}
	if len(blocks) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	w.Header().Add("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(blocks)
}
// title: event block list
// path: /events/blocks
// method: GET
// produce: application/json
// responses:
//   200: OK
//   204: No content
//   401: Unauthorized