commit | 07031b0407e0d3812a142c94405f6333d0e6a8d8 | [log] [tgz] |
---|---|---|
author | Marco Miller <marco.miller@ericsson.com> | Fri Jun 14 14:39:54 2019 -0400 |
committer | Marco Miller <marco.miller@ericsson.com> | Mon Jun 17 12:20:21 2019 -0400 |
tree | 7b3c0fc9920e734c1e3edce0e001485752315ad3 | |
parent | 31c68090ba7ed53755a410f4de6db9669e5de5c2 [diff] |
ProjectControl: Allow regexes ref strings for tags Before this change, only ref strings not starting with the regex prefix for tags allowed to show the tag creation form. This was against the documentation [1] saying that "Reference names can also be described with a regular expression by prefixing the reference name with ^." [1] https://gerrit-documentation.storage.googleapis.com/Documentation/2.15.14/access-control.html#_project_access_control_lists Bug: Issue 10763 Change-Id: If6fbac1e2998c9fb63679c8a4fd2f5d311af4441
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/ProjectControl.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/ProjectControl.java index c77c1cd..1a51424 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/ProjectControl.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/ProjectControl.java
@@ -16,6 +16,7 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.gerrit.common.data.AccessSection.ALL; +import static com.google.gerrit.common.data.RefConfigSection.REGEX_PREFIX; import static com.google.gerrit.reviewdb.client.RefNames.REFS_TAGS; import static com.google.gerrit.server.util.MagicBranch.NEW_CHANGE; @@ -292,7 +293,8 @@ for (SectionMatcher matcher : access()) { AccessSection section = matcher.section; - if (section.getName().startsWith(REFS_TAGS)) { + if (section.getName().startsWith(REFS_TAGS) + || section.getName().startsWith(REGEX_PREFIX + REFS_TAGS)) { Permission permission = section.getPermission(permissionName); if (permission == null) { continue;