-
-
Notifications
You must be signed in to change notification settings - Fork 598
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
ACL: Add projects to team should only show not yet added projects #3261
Conversation
…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}") |
There was a problem hiding this comment.
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:
dependency-track/src/main/java/org/dependencytrack/resources/v1/ProjectResource.java
Lines 88 to 98 in 2f16cae
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(); | |
} | |
} |
There was a problem hiding this comment.
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
Signed-off-by: Ralf King <[email protected]>
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
This PR fixes a defect, and I have provided tests to verify that the fix is effectiveThis PR introduces changes to the database model, and I have added corresponding update logic