Merge branch 'stable-3.1'
* stable-3.1: Fix Access when the only readable ref is a RegExp with a gerrit pattern e2e-tests: Mention http credentials in documentation Fix refPattern when using username/shardeduserid pattern with regexp Enable optional DEBUG level logs for query tests Change-Id: Ia713e8dba63c0ddf69fb138cdc0f83d7839ba863
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package com.google.gerrit.server.permissions;
|
||||
|
||||
import static com.google.gerrit.common.data.PermissionRule.Action.BLOCK;
|
||||
import static com.google.gerrit.server.project.RefPattern.containsParameters;
|
||||
import static com.google.gerrit.server.project.RefPattern.isRE;
|
||||
import static java.util.stream.Collectors.mapping;
|
||||
import static java.util.stream.Collectors.toList;
|
||||
@@ -131,7 +132,9 @@ public class PermissionCollection {
|
||||
Iterable<SectionMatcher> matcherList, String ref, CurrentUser user) {
|
||||
try (Timer0.Context ignored = filterLatency.start()) {
|
||||
if (isRE(ref)) {
|
||||
ref = RefPattern.shortestExample(ref);
|
||||
if (!containsParameters(ref)) {
|
||||
ref = RefPattern.shortestExample(ref);
|
||||
}
|
||||
} else if (ref.endsWith("/*")) {
|
||||
ref = ref.substring(0, ref.length() - 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user