Convert ListChildProjects to PermissionBackend

Rewrite the code to use Java 8 streams and the new
PermissionBackend to filter batches of direct children
for ACCESS permission.

Change-Id: I7ca6b5566a6ec675760dc937db369e9150546dd3
This commit is contained in:
Shawn Pearce
2017-02-22 22:03:33 -08:00
committed by David Pursehouse
parent cb149254bb
commit 571f99c02a
4 changed files with 108 additions and 56 deletions

View File

@@ -378,7 +378,11 @@ public class ProjectApiImpl implements ProjectApi {
public List<ProjectInfo> children(boolean recursive) throws RestApiException {
ListChildProjects list = children.list();
list.setRecursive(recursive);
return list.apply(checkExists());
try {
return list.apply(checkExists());
} catch (PermissionBackendException e) {
throw new RestApiException("Cannot list children", e);
}
}
@Override