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;