            "Registered read"
            ["registered" "read"] read-acls
 
-           "Registered create"
-           ["registered" "create"] [acl5 acl8]
-
            "Group create"
-           ["AG12345-PROV" "create"] AG12345-acls
+           ["AG10000-PROV" "create"] [acl8]
+
+           "Registered order"
+           ["registered" "order"] [acl5]
+
+           "Group create"
+           ["AG12345-PROV" "create"] [acl3]
 
            "Another group create"
            ["AG10000-PROV" "create"] AG10000-acls

           "Group read"
           ["AG12345-PROV" "read"] []

           "Case-insensitive group create"
           ["AG10000-PROV" "CREATE"] AG10000-acls

           ;; CMR-3154 acceptance criterium 2
           "Registered read or registered create"
           ["registered" "read" "registered" "create"] registered-acls

           "Registered read or group AG12345-PROV create"
           ["registered" "read" "AG12345-PROV" "create"] (conj AG12345-acls acl2)))

    ;; CMR-3154 acceptance criterium 3
    (testing "Search ACLs by group permission just group or permission"

        acl4 (ingest-acl token (provider-acl "AUDIT_REPORT"))
        acl5 (ingest-acl token (assoc (provider-acl "OPTION_DEFINITION")
                                      :group_permissions
                                      [{:user_type "registered" :permissions ["order"]}]))
        acl6 (ingest-acl token (assoc (provider-acl "OPTION_ASSIGNMENT")
                                      :group_permissions
                                      [{:group_id "AG12345-PROV" :permissions ["delete"]}]))

        acl7 (ingest-acl token (catalog-item-acl "All Collections"))
        acl8 (ingest-acl token (assoc (catalog-item-acl "All Granules")
                                      :group_permissions
                                      [{:user_type "registered" :permissions ["read"]}
                                       {:group_id "AG10000-PROV" :permissions ["create"]}]))

        guest-acls [acl1 acl4 acl7]
        registered-acls [acl2 acl5 acl8]
        AG12345-acls [acl3 acl6]
        AG10000-acls [acl8]
        read-acls [acl2 acl8]
        create-acls [acl1 acl3 acl4 acl7 acl8]
        all-acls (concat guest-acls registered-acls AG12345-acls)]
    (u/wait-until-indexed)

