@@ -343,34 +343,6 @@ class DatasetController @Inject()(userService: UserService,
343343 } yield Ok (Json .toJson(usersJs))
344344 }
345345
346- // Note that dataSource is also included in the full publicWrites. This
347- def readDataSource (datasetId : ObjectId ,
348- // Optional sharing token allowing access to datasets your team does not normally have access to.")
349- sharingToken : Option [String ]): Action [AnyContent ] =
350- sil.UserAwareAction .async { implicit request =>
351- log() {
352- val ctx = URLSharing .fallbackTokenAccessContext(sharingToken)
353- for {
354- dataset <- datasetDAO.findOne(datasetId)(ctx) ?~> notFoundMessage(datasetId.toString) ~> NOT_FOUND
355- organization <- organizationDAO.findOne(dataset._organization)(GlobalAccessContext ) ~> NOT_FOUND
356- _ <- Fox .runOptional(request.identity)(user =>
357- datasetLastUsedTimesDAO.updateForDatasetAndUser(dataset._id, user._id))
358- // Access checked above via dataset. In case of shared dataset/annotation, show datastore even if not otherwise accessible
359- dataStore <- datasetService.dataStoreFor(dataset)(GlobalAccessContext )
360- js <- datasetService.publicWrites(dataset, request.identity, Some (organization), Some (dataStore))
361- _ = request.identity.map { user =>
362- analyticsService.track(OpenDatasetEvent (user, dataset))
363- if (dataset.isPublic) {
364- mailchimpClient.tagUser(user, MailchimpTag .HasViewedPublishedDataset )
365- }
366- userDAO.updateLastActivity(user._id)
367- }
368- } yield {
369- Ok (Json .toJson(js))
370- }
371- }
372- }
373-
374346 def read (datasetId : ObjectId ,
375347 // Optional sharing token allowing access to datasets your team does not normally have access to.")
376348 sharingToken : Option [String ]): Action [AnyContent ] =
0 commit comments