     end
   end
 
-  defp authorize(dataset_name) do
+  defp authorize_group(group_name) do
+    if group_name != "BXD" do
+      raise "Authorization error for " <> group_name
+    end
+  end
+
+  defp authorize_dataset(dataset_name) do
     subq =
       case use_type(dataset_name) do
         { :integer, i } -> "D.id = #{i}"

  end

  def datasets(group) do
    query = """
SELECT DISTINCT D.Id,D.Name,D.FullName
FROM ProbeSetFreeze AS D, ProbeFreeze as D2, InbredSet, Tissue, Species

  end

  def phenotypes(dataset_name, start, stop) do
    authorize_dataset(dataset_name)
    dataset_id =
      case use_type(dataset_name) do
        { :integer, i } -> i
