if message.requested?(:organization_guids)
          space_guids_from_orgs = Space.join(:organizations, id: :organization_id).
                                  where(organizations__guid: message.organization_guids).
                                  select(:spaces__guid)
          app_dataset = app_dataset.where(space_guid: space_guids_from_orgs)