Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACL: Add projects to team should only show not yet added projects #3261

Conversation

rkg-mm
Copy link
Contributor

@rkg-mm rkg-mm commented Dec 3, 2023

Description

ACL: Add projects to team should only show not yet added projects
Required for Frontend PR: DependencyTrack/frontend#662

Addressed Issue

DependencyTrack/frontend#101

Additional Details

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

…ist projects that are not already added.

Signed-off-by: Ralf King <[email protected]>
Signed-off-by: Ralf King <[email protected]>
@@ -160,4 +161,35 @@ public Response deleteMapping(
}
}
}

@GET
@Path("/notassignedprojects/{teamUuid}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be added to the /api/v1/project endpoint instead? We already have a few query parameters there that allow for filtering of results:

public Response getProjects(@ApiParam(value = "The optional name of the project to query on", required = false)
@QueryParam("name") String name,
@ApiParam(value = "Optionally excludes inactive projects from being returned", required = false)
@QueryParam("excludeInactive") boolean excludeInactive,
@ApiParam(value = "Optionally excludes children projects from being returned", required = false)
@QueryParam("onlyRoot") boolean onlyRoot) {
try (QueryManager qm = new QueryManager(getAlpineRequest())) {
final PaginatedResult result = (name != null) ? qm.getProjects(name, excludeInactive, onlyRoot) : qm.getProjects(true, excludeInactive, onlyRoot);
return Response.ok(result.getObjects()).header(TOTAL_COUNT_HEADER, result.getTotal()).build();
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, makes sense. Done

@nscuro nscuro added this to the 4.11 milestone Dec 3, 2023
@nscuro nscuro merged commit 1e64932 into DependencyTrack:master Jan 15, 2024
7 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants