GetAccess: Fix read config permission check
In I3707ff00 this was changed in GetAccess such that it no longer matches ProjectAccessFactory. The change seemed harmless, but had unintended consequences. Revert to the known-working implementation while further investigation is underway. Bug: Issue 7495 Change-Id: If42f1f2ae725e66fede8139a8bcccab3bedfbf99
This commit is contained in:
@@ -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<>();
|
||||
|
@@ -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()) {
|
||||
|
Reference in New Issue
Block a user