Skip to content

Commit

Permalink
Fix dataset access by sharing token (#6425)
Browse files Browse the repository at this point in the history
  • Loading branch information
fm3 authored Aug 25, 2022
1 parent c36ba0f commit d357dd6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/models/binary/DataSet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,12 @@ class DataSetDAO @Inject()(sqlClient: SQLClient,
}

override def anonymousReadAccessQ(token: Option[String]): String =
"isPublic" + token
.map(
t =>
" or sharingToken = '$t' or _id in (select ans._dataset " +
"from webknossos.annotation_privateLinks_ apl " +
"join webknossos.annotations_ ans ON apl._annotation = ans._id " +
s"where apl.accessToken = '$t')")
.getOrElse("")
"isPublic" + token.map(t => s""" or sharingToken = '$t'
or _id in
(select ans._dataset
from webknossos.annotation_privateLinks_ apl
join webknossos.annotations_ ans ON apl._annotation = ans._id
where apl.accessToken = '$t')""").getOrElse("")

override def readAccessQ(requestingUserId: ObjectId) =
s"""isPublic
Expand Down

0 comments on commit d357dd6

Please sign in to comment.