Merge "GetAccess: Fix read config permission check"
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<>();
|
List<AccessSection> local = new ArrayList<>();
|
||||||
Set<String> ownerOf = new HashSet<>();
|
Set<String> ownerOf = new HashSet<>();
|
||||||
Map<AccountGroup.UUID, Boolean> visibleGroups = new HashMap<>();
|
Map<AccountGroup.UUID, Boolean> visibleGroups = new HashMap<>();
|
||||||
|
@@ -162,10 +162,12 @@ public class GetAccess implements RestReadView<ProjectResource> {
|
|||||||
throw new ResourceNotFoundException(rsrc.getName());
|
throw new ResourceNotFoundException(rsrc.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The following implementation must match the ProjectAccessFactory JSON RPC endpoint.
|
||||||
|
|
||||||
info.local = new HashMap<>();
|
info.local = new HashMap<>();
|
||||||
info.ownerOf = new HashSet<>();
|
info.ownerOf = new HashSet<>();
|
||||||
Map<AccountGroup.UUID, GroupInfo> visibleGroups = new HashMap<>();
|
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);
|
boolean canWriteConfig = check(perm, ProjectPermission.WRITE_CONFIG);
|
||||||
|
|
||||||
for (AccessSection section : config.getAccessSections()) {
|
for (AccessSection section : config.getAccessSections()) {
|
||||||
|
Reference in New Issue
Block a user