Merge "GetAccess: Fix read config permission check"

This commit is contained in:
Paladox none
2017-10-25 15:59:06 +00:00
committed by Gerrit Code Review
2 changed files with 5 additions and 1 deletions

View File

@@ -125,6 +125,8 @@ class ProjectAccessFactory extends Handler<ProjectAccess> {
}
}
// The following implementation must match the GetAccess REST API endpoint.
List<AccessSection> local = new ArrayList<>();
Set<String> ownerOf = new HashSet<>();
Map<AccountGroup.UUID, Boolean> visibleGroups = new HashMap<>();

View File

@@ -162,10 +162,12 @@ public class GetAccess implements RestReadView<ProjectResource> {
throw new ResourceNotFoundException(rsrc.getName());
}
// The following implementation must match the ProjectAccessFactory JSON RPC endpoint.
info.local = new HashMap<>();
info.ownerOf = new HashSet<>();
Map<AccountGroup.UUID, GroupInfo> visibleGroups = new HashMap<>();
boolean canReadConfig = check(perm, ProjectPermission.READ_CONFIG);
boolean canReadConfig = check(perm, RefNames.REFS_CONFIG, READ);
boolean canWriteConfig = check(perm, ProjectPermission.WRITE_CONFIG);
for (AccessSection section : config.getAccessSections()) {