Skip to content

Commit

Permalink
commit progress update #1659
Browse files Browse the repository at this point in the history
  • Loading branch information
salomon-j committed Jan 20, 2025
1 parent fc58251 commit 3a333ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1820,6 +1820,12 @@ class BioActivityController {
in = ParameterIn.PATH,
required = true,
description = "Activity id"
),
@Parameter(
name = "includeSiteData",
in = ParameterIn.PATH,
description = "Include site data",
schema = @Schema(type = "boolean", defaultValue = "false")
)
],
responses = [
Expand Down Expand Up @@ -1854,8 +1860,8 @@ class BioActivityController {
],
security = @SecurityRequirement(name="auth")
)
@Path("ws/bioactivity/data/simplified/{id}")
def getOutputForActivitySimplified(String id){
@Path("ws/bioactivity/data/simplified/{id}/{includeSiteData}")
def getOutputForActivitySimplified(String id, boolean includeSiteData){
String userId = userService.getCurrentUserId()
def activity = activityService.get(id)
String projectId = activity?.projectId
Expand All @@ -1872,6 +1878,10 @@ class BioActivityController {
model.error = "No project associated with the activity"
} else if (projectService.isUserAdminForProject(userId, projectId) || activityService.isUserOwnerForActivity(userId, activity?.activityId)) {
model = [activity: activity]
if (includeSiteData) {
model = activityAndOutputModel(activity, activity.projectId)
}

} else {
response.status = 401
model.error = "Access denied: User is not an owner of this activity ${activity?.activityId}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class ProjectSearchResponse {
List<Facet> facets
}

// classes for "ws/bioactivity/data/simplified/{id}
// classes for "ws/bioactivity/data/simplified/{id}/{includeSiteData}
@JsonIgnoreProperties('metaClass')
class GetOutputForActivitySimplifiedResponse {
Map activity
Expand Down

0 comments on commit 3a333ff

Please sign in to comment.