Skip to content

Commit

Permalink
Filter out unauthorized studies when fetching study tags using @PreFi…
Browse files Browse the repository at this point in the history
  • Loading branch information
Bas Leenknegt committed Jul 17, 2023
1 parent b3400e6 commit 0d8a80c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/src/main/java/org/cbioportal/web/StudyController.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreFilter;
import org.springframework.security.core.Authentication;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
Expand Down Expand Up @@ -180,7 +181,7 @@ public ResponseEntity<Object> getTags(
return new ResponseEntity<>(map, HttpStatus.OK);
}

@PreAuthorize("hasPermission(#studyIds, 'Collection<CancerStudyId>', T(org.cbioportal.utils.security.AccessLevel).READ)")
@PreFilter("hasPermission(#studyIds, 'Collection<CancerStudyId>', T(org.cbioportal.utils.security.AccessLevel).READ)")
@RequestMapping(value = "/studies/tags/fetch", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_VALUE)
@ApiOperation("Get the study tags by IDs")
Expand Down

0 comments on commit 0d8a80c

Please sign in to comment.